Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Add Span kind to the Span. #51

Merged
merged 1 commit into from
Mar 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions opencensus/proto/trace/trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ option go_package = "traceproto";
// its sub-operations. A trace can also contain multiple root spans,
// or none at all. Spans do not need to be contiguous - there may be
// gaps or overlaps between spans in a trace.
//
// The next id is 15.
// TODO(bdrutu): Add an example.
message Span {
// A unique identifier for a trace. All spans from the same trace share
Expand Down Expand Up @@ -59,6 +61,26 @@ message Span {
// This field is required.
TruncatableString name = 4;

// Type of span. Can be used to specify additional relationships between spans
// in addition to a parent/child relationship.
enum SpanKind {
// Unspecified.
SPAN_KIND_UNSPECIFIED = 0;

// Indicates that the span covers server-side handling of an RPC or other
// remote network request.
SERVER = 1;

// Indicates that the span covers the client-side wrapper around an RPC or
// other remote request.
CLIENT = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add PRODUCER and CONSUMER as they are widely used, and indicate sending to a broker instead of directly to a server and visa versa

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenTracing also has producer and consumer types. Might be good if we have that.

}

// Distinguishes between spans generated in a particular context. For example,
// two spans with the same name may be distinguished using `CLIENT`
// and `SERVER` to identify queueing latency associated with the span.
SpanKind kind = 14;

// The start time of the span. On the client side, this is the time kept by
// the local machine where the span execution starts. On the server side, this
// is the time when the server's application handler starts running.
Expand Down