@@ -31,6 +31,8 @@ option go_package = "traceproto";
3131// its sub-operations. A trace can also contain multiple root spans,
3232// or none at all. Spans do not need to be contiguous - there may be
3333// gaps or overlaps between spans in a trace.
34+ //
35+ // The next id is 15.
3436// TODO(bdrutu): Add an example.
3537message Span {
3638 // A unique identifier for a trace. All spans from the same trace share
@@ -59,6 +61,26 @@ message Span {
5961 // This field is required.
6062 TruncatableString name = 4 ;
6163
64+ // Type of span. Can be used to specify additional relationships between spans
65+ // in addition to a parent/child relationship.
66+ enum SpanKind {
67+ // Unspecified.
68+ SPAN_KIND_UNSPECIFIED = 0 ;
69+
70+ // Indicates that the span covers server-side handling of an RPC or other
71+ // remote network request.
72+ SERVER = 1 ;
73+
74+ // Indicates that the span covers the client-side wrapper around an RPC or
75+ // other remote request.
76+ CLIENT = 2 ;
77+ }
78+
79+ // Distinguishes between spans generated in a particular context. For example,
80+ // two spans with the same name may be distinguished using `CLIENT`
81+ // and `SERVER` to identify queueing latency associated with the span.
82+ SpanKind kind = 14 ;
83+
6284 // The start time of the span. On the client side, this is the time kept by
6385 // the local machine where the span execution starts. On the server side, this
6486 // is the time when the server's application handler starts running.
0 commit comments