xds_api/generated/
opencensus.proto.trace.v1.rs

1// This file is @generated by prost-build.
2/// Global configuration of the trace service. All fields must be specified, or
3/// the default (zero) values will be used for each type.
4#[derive(Clone, Copy, PartialEq, ::prost::Message)]
5pub struct TraceConfig {
6    /// The global default max number of attributes per span.
7    #[prost(int64, tag = "4")]
8    pub max_number_of_attributes: i64,
9    /// The global default max number of annotation events per span.
10    #[prost(int64, tag = "5")]
11    pub max_number_of_annotations: i64,
12    /// The global default max number of message events per span.
13    #[prost(int64, tag = "6")]
14    pub max_number_of_message_events: i64,
15    /// The global default max number of link entries per span.
16    #[prost(int64, tag = "7")]
17    pub max_number_of_links: i64,
18    /// The global default sampler used to make decisions on span sampling.
19    #[prost(oneof = "trace_config::Sampler", tags = "1, 2, 3")]
20    pub sampler: ::core::option::Option<trace_config::Sampler>,
21}
22/// Nested message and enum types in `TraceConfig`.
23pub mod trace_config {
24    /// The global default sampler used to make decisions on span sampling.
25    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
26    pub enum Sampler {
27        #[prost(message, tag = "1")]
28        ProbabilitySampler(super::ProbabilitySampler),
29        #[prost(message, tag = "2")]
30        ConstantSampler(super::ConstantSampler),
31        #[prost(message, tag = "3")]
32        RateLimitingSampler(super::RateLimitingSampler),
33    }
34}
35impl ::prost::Name for TraceConfig {
36    const NAME: &'static str = "TraceConfig";
37    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
38    fn full_name() -> ::prost::alloc::string::String {
39        "opencensus.proto.trace.v1.TraceConfig".into()
40    }
41    fn type_url() -> ::prost::alloc::string::String {
42        "/opencensus.proto.trace.v1.TraceConfig".into()
43    }
44}
45/// Sampler that tries to uniformly sample traces with a given probability.
46/// The probability of sampling a trace is equal to that of the specified probability.
47#[derive(Clone, Copy, PartialEq, ::prost::Message)]
48pub struct ProbabilitySampler {
49    /// The desired probability of sampling. Must be within \[0.0, 1.0\].
50    #[prost(double, tag = "1")]
51    pub sampling_probability: f64,
52}
53impl ::prost::Name for ProbabilitySampler {
54    const NAME: &'static str = "ProbabilitySampler";
55    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
56    fn full_name() -> ::prost::alloc::string::String {
57        "opencensus.proto.trace.v1.ProbabilitySampler".into()
58    }
59    fn type_url() -> ::prost::alloc::string::String {
60        "/opencensus.proto.trace.v1.ProbabilitySampler".into()
61    }
62}
63/// Sampler that always makes a constant decision on span sampling.
64#[derive(Clone, Copy, PartialEq, ::prost::Message)]
65pub struct ConstantSampler {
66    #[prost(enumeration = "constant_sampler::ConstantDecision", tag = "1")]
67    pub decision: i32,
68}
69/// Nested message and enum types in `ConstantSampler`.
70pub mod constant_sampler {
71    /// How spans should be sampled:
72    /// - Always off
73    /// - Always on
74    /// - Always follow the parent Span's decision (off if no parent).
75    #[derive(
76        Clone,
77        Copy,
78        Debug,
79        PartialEq,
80        Eq,
81        Hash,
82        PartialOrd,
83        Ord,
84        ::prost::Enumeration
85    )]
86    #[repr(i32)]
87    pub enum ConstantDecision {
88        AlwaysOff = 0,
89        AlwaysOn = 1,
90        AlwaysParent = 2,
91    }
92    impl ConstantDecision {
93        /// String value of the enum field names used in the ProtoBuf definition.
94        ///
95        /// The values are not transformed in any way and thus are considered stable
96        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
97        pub fn as_str_name(&self) -> &'static str {
98            match self {
99                Self::AlwaysOff => "ALWAYS_OFF",
100                Self::AlwaysOn => "ALWAYS_ON",
101                Self::AlwaysParent => "ALWAYS_PARENT",
102            }
103        }
104        /// Creates an enum from field names used in the ProtoBuf definition.
105        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
106            match value {
107                "ALWAYS_OFF" => Some(Self::AlwaysOff),
108                "ALWAYS_ON" => Some(Self::AlwaysOn),
109                "ALWAYS_PARENT" => Some(Self::AlwaysParent),
110                _ => None,
111            }
112        }
113    }
114}
115impl ::prost::Name for ConstantSampler {
116    const NAME: &'static str = "ConstantSampler";
117    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
118    fn full_name() -> ::prost::alloc::string::String {
119        "opencensus.proto.trace.v1.ConstantSampler".into()
120    }
121    fn type_url() -> ::prost::alloc::string::String {
122        "/opencensus.proto.trace.v1.ConstantSampler".into()
123    }
124}
125/// Sampler that tries to sample with a rate per time window.
126#[derive(Clone, Copy, PartialEq, ::prost::Message)]
127pub struct RateLimitingSampler {
128    /// Rate per second.
129    #[prost(int64, tag = "1")]
130    pub qps: i64,
131}
132impl ::prost::Name for RateLimitingSampler {
133    const NAME: &'static str = "RateLimitingSampler";
134    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
135    fn full_name() -> ::prost::alloc::string::String {
136        "opencensus.proto.trace.v1.RateLimitingSampler".into()
137    }
138    fn type_url() -> ::prost::alloc::string::String {
139        "/opencensus.proto.trace.v1.RateLimitingSampler".into()
140    }
141}
142/// A span represents a single operation within a trace. Spans can be
143/// nested to form a trace tree. Spans may also be linked to other spans
144/// from the same or different trace. And form graphs. Often, a trace
145/// contains a root span that describes the end-to-end latency, and one
146/// or more subspans for its sub-operations. A trace can also contain
147/// multiple root spans, or none at all. Spans do not need to be
148/// contiguous - there may be gaps or overlaps between spans in a trace.
149///
150/// The next id is 17.
151/// TODO(bdrutu): Add an example.
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct Span {
154    /// A unique identifier for a trace. All spans from the same trace share
155    /// the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
156    /// is considered invalid.
157    ///
158    /// This field is semantically required. Receiver should generate new
159    /// random trace_id if empty or invalid trace_id was received.
160    ///
161    /// This field is required.
162    #[prost(bytes = "vec", tag = "1")]
163    pub trace_id: ::prost::alloc::vec::Vec<u8>,
164    /// A unique identifier for a span within a trace, assigned when the span
165    /// is created. The ID is an 8-byte array. An ID with all zeroes is considered
166    /// invalid.
167    ///
168    /// This field is semantically required. Receiver should generate new
169    /// random span_id if empty or invalid span_id was received.
170    ///
171    /// This field is required.
172    #[prost(bytes = "vec", tag = "2")]
173    pub span_id: ::prost::alloc::vec::Vec<u8>,
174    /// The Tracestate on the span.
175    #[prost(message, optional, tag = "15")]
176    pub tracestate: ::core::option::Option<span::Tracestate>,
177    /// The `span_id` of this span's parent span. If this is a root span, then this
178    /// field must be empty. The ID is an 8-byte array.
179    #[prost(bytes = "vec", tag = "3")]
180    pub parent_span_id: ::prost::alloc::vec::Vec<u8>,
181    /// A description of the span's operation.
182    ///
183    /// For example, the name can be a qualified method name or a file name
184    /// and a line number where the operation is called. A best practice is to use
185    /// the same display name at the same call point in an application.
186    /// This makes it easier to correlate spans in different traces.
187    ///
188    /// This field is semantically required to be set to non-empty string.
189    /// When null or empty string received - receiver may use string "name"
190    /// as a replacement. There might be smarted algorithms implemented by
191    /// receiver to fix the empty span name.
192    ///
193    /// This field is required.
194    #[prost(message, optional, tag = "4")]
195    pub name: ::core::option::Option<TruncatableString>,
196    /// Distinguishes between spans generated in a particular context. For example,
197    /// two spans with the same name may be distinguished using `CLIENT` (caller)
198    /// and `SERVER` (callee) to identify queueing latency associated with the span.
199    #[prost(enumeration = "span::SpanKind", tag = "14")]
200    pub kind: i32,
201    /// The start time of the span. On the client side, this is the time kept by
202    /// the local machine where the span execution starts. On the server side, this
203    /// is the time when the server's application handler starts running.
204    ///
205    /// This field is semantically required. When not set on receive -
206    /// receiver should set it to the value of end_time field if it was
207    /// set. Or to the current time if neither was set. It is important to
208    /// keep end_time > start_time for consistency.
209    ///
210    /// This field is required.
211    #[prost(message, optional, tag = "5")]
212    pub start_time: ::core::option::Option<
213        super::super::super::super::google::protobuf::Timestamp,
214    >,
215    /// The end time of the span. On the client side, this is the time kept by
216    /// the local machine where the span execution ends. On the server side, this
217    /// is the time when the server application handler stops running.
218    ///
219    /// This field is semantically required. When not set on receive -
220    /// receiver should set it to start_time value. It is important to
221    /// keep end_time > start_time for consistency.
222    ///
223    /// This field is required.
224    #[prost(message, optional, tag = "6")]
225    pub end_time: ::core::option::Option<
226        super::super::super::super::google::protobuf::Timestamp,
227    >,
228    /// A set of attributes on the span.
229    #[prost(message, optional, tag = "7")]
230    pub attributes: ::core::option::Option<span::Attributes>,
231    /// A stack trace captured at the start of the span.
232    #[prost(message, optional, tag = "8")]
233    pub stack_trace: ::core::option::Option<StackTrace>,
234    /// The included time events.
235    #[prost(message, optional, tag = "9")]
236    pub time_events: ::core::option::Option<span::TimeEvents>,
237    /// The included links.
238    #[prost(message, optional, tag = "10")]
239    pub links: ::core::option::Option<span::Links>,
240    /// An optional final status for this span. Semantically when Status
241    /// wasn't set it is means span ended without errors and assume
242    /// Status.Ok (code = 0).
243    #[prost(message, optional, tag = "11")]
244    pub status: ::core::option::Option<Status>,
245    /// An optional resource that is associated with this span. If not set, this span
246    /// should be part of a batch that does include the resource information, unless resource
247    /// information is unknown.
248    #[prost(message, optional, tag = "16")]
249    pub resource: ::core::option::Option<super::super::resource::v1::Resource>,
250    /// A highly recommended but not required flag that identifies when a
251    /// trace crosses a process boundary. True when the parent_span belongs
252    /// to the same process as the current span. This flag is most commonly
253    /// used to indicate the need to adjust time as clocks in different
254    /// processes may not be synchronized.
255    #[prost(message, optional, tag = "12")]
256    pub same_process_as_parent_span: ::core::option::Option<
257        super::super::super::super::google::protobuf::BoolValue,
258    >,
259    /// An optional number of child spans that were generated while this span
260    /// was active. If set, allows an implementation to detect missing child spans.
261    #[prost(message, optional, tag = "13")]
262    pub child_span_count: ::core::option::Option<
263        super::super::super::super::google::protobuf::UInt32Value,
264    >,
265}
266/// Nested message and enum types in `Span`.
267pub mod span {
268    /// This field conveys information about request position in multiple distributed tracing graphs.
269    /// It is a list of Tracestate.Entry with a maximum of 32 members in the list.
270    ///
271    /// See the <https://github.com/w3c/distributed-tracing> for more details about this field.
272    #[derive(Clone, PartialEq, ::prost::Message)]
273    pub struct Tracestate {
274        /// A list of entries that represent the Tracestate.
275        #[prost(message, repeated, tag = "1")]
276        pub entries: ::prost::alloc::vec::Vec<tracestate::Entry>,
277    }
278    /// Nested message and enum types in `Tracestate`.
279    pub mod tracestate {
280        #[derive(Clone, PartialEq, ::prost::Message)]
281        pub struct Entry {
282            /// The key must begin with a lowercase letter, and can only contain
283            /// lowercase letters 'a'-'z', digits '0'-'9', underscores '_', dashes
284            /// '-', asterisks '*', and forward slashes '/'.
285            #[prost(string, tag = "1")]
286            pub key: ::prost::alloc::string::String,
287            /// The value is opaque string up to 256 characters printable ASCII
288            /// RFC0020 characters (i.e., the range 0x20 to 0x7E) except ',' and '='.
289            /// Note that this also excludes tabs, newlines, carriage returns, etc.
290            #[prost(string, tag = "2")]
291            pub value: ::prost::alloc::string::String,
292        }
293        impl ::prost::Name for Entry {
294            const NAME: &'static str = "Entry";
295            const PACKAGE: &'static str = "opencensus.proto.trace.v1";
296            fn full_name() -> ::prost::alloc::string::String {
297                "opencensus.proto.trace.v1.Span.Tracestate.Entry".into()
298            }
299            fn type_url() -> ::prost::alloc::string::String {
300                "/opencensus.proto.trace.v1.Span.Tracestate.Entry".into()
301            }
302        }
303    }
304    impl ::prost::Name for Tracestate {
305        const NAME: &'static str = "Tracestate";
306        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
307        fn full_name() -> ::prost::alloc::string::String {
308            "opencensus.proto.trace.v1.Span.Tracestate".into()
309        }
310        fn type_url() -> ::prost::alloc::string::String {
311            "/opencensus.proto.trace.v1.Span.Tracestate".into()
312        }
313    }
314    /// A set of attributes, each with a key and a value.
315    #[derive(Clone, PartialEq, ::prost::Message)]
316    pub struct Attributes {
317        /// The set of attributes. The value can be a string, an integer, a double
318        /// or the Boolean values `true` or `false`. Note, global attributes like
319        /// server name can be set as tags using resource API. Examples of attributes:
320        ///
321        ///      "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
322        ///      "/http/server_latency": 300
323        ///      "abc.com/myattribute": true
324        ///      "abc.com/score": 10.239
325        #[prost(map = "string, message", tag = "1")]
326        pub attribute_map: ::std::collections::HashMap<
327            ::prost::alloc::string::String,
328            super::AttributeValue,
329        >,
330        /// The number of attributes that were discarded. Attributes can be discarded
331        /// because their keys are too long or because there are too many attributes.
332        /// If this value is 0, then no attributes were dropped.
333        #[prost(int32, tag = "2")]
334        pub dropped_attributes_count: i32,
335    }
336    impl ::prost::Name for Attributes {
337        const NAME: &'static str = "Attributes";
338        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
339        fn full_name() -> ::prost::alloc::string::String {
340            "opencensus.proto.trace.v1.Span.Attributes".into()
341        }
342        fn type_url() -> ::prost::alloc::string::String {
343            "/opencensus.proto.trace.v1.Span.Attributes".into()
344        }
345    }
346    /// A time-stamped annotation or message event in the Span.
347    #[derive(Clone, PartialEq, ::prost::Message)]
348    pub struct TimeEvent {
349        /// The time the event occurred.
350        #[prost(message, optional, tag = "1")]
351        pub time: ::core::option::Option<
352            super::super::super::super::super::google::protobuf::Timestamp,
353        >,
354        /// A `TimeEvent` can contain either an `Annotation` object or a
355        /// `MessageEvent` object, but not both.
356        #[prost(oneof = "time_event::Value", tags = "2, 3")]
357        pub value: ::core::option::Option<time_event::Value>,
358    }
359    /// Nested message and enum types in `TimeEvent`.
360    pub mod time_event {
361        /// A text annotation with a set of attributes.
362        #[derive(Clone, PartialEq, ::prost::Message)]
363        pub struct Annotation {
364            /// A user-supplied message describing the event.
365            #[prost(message, optional, tag = "1")]
366            pub description: ::core::option::Option<super::super::TruncatableString>,
367            /// A set of attributes on the annotation.
368            #[prost(message, optional, tag = "2")]
369            pub attributes: ::core::option::Option<super::Attributes>,
370        }
371        impl ::prost::Name for Annotation {
372            const NAME: &'static str = "Annotation";
373            const PACKAGE: &'static str = "opencensus.proto.trace.v1";
374            fn full_name() -> ::prost::alloc::string::String {
375                "opencensus.proto.trace.v1.Span.TimeEvent.Annotation".into()
376            }
377            fn type_url() -> ::prost::alloc::string::String {
378                "/opencensus.proto.trace.v1.Span.TimeEvent.Annotation".into()
379            }
380        }
381        /// An event describing a message sent/received between Spans.
382        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
383        pub struct MessageEvent {
384            /// The type of MessageEvent. Indicates whether the message was sent or
385            /// received.
386            #[prost(enumeration = "message_event::Type", tag = "1")]
387            pub r#type: i32,
388            /// An identifier for the MessageEvent's message that can be used to match
389            /// SENT and RECEIVED MessageEvents. For example, this field could
390            /// represent a sequence ID for a streaming RPC. It is recommended to be
391            /// unique within a Span.
392            #[prost(uint64, tag = "2")]
393            pub id: u64,
394            /// The number of uncompressed bytes sent or received.
395            #[prost(uint64, tag = "3")]
396            pub uncompressed_size: u64,
397            /// The number of compressed bytes sent or received. If zero, assumed to
398            /// be the same size as uncompressed.
399            #[prost(uint64, tag = "4")]
400            pub compressed_size: u64,
401        }
402        /// Nested message and enum types in `MessageEvent`.
403        pub mod message_event {
404            /// Indicates whether the message was sent or received.
405            #[derive(
406                Clone,
407                Copy,
408                Debug,
409                PartialEq,
410                Eq,
411                Hash,
412                PartialOrd,
413                Ord,
414                ::prost::Enumeration
415            )]
416            #[repr(i32)]
417            pub enum Type {
418                /// Unknown event type.
419                Unspecified = 0,
420                /// Indicates a sent message.
421                Sent = 1,
422                /// Indicates a received message.
423                Received = 2,
424            }
425            impl Type {
426                /// String value of the enum field names used in the ProtoBuf definition.
427                ///
428                /// The values are not transformed in any way and thus are considered stable
429                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
430                pub fn as_str_name(&self) -> &'static str {
431                    match self {
432                        Self::Unspecified => "TYPE_UNSPECIFIED",
433                        Self::Sent => "SENT",
434                        Self::Received => "RECEIVED",
435                    }
436                }
437                /// Creates an enum from field names used in the ProtoBuf definition.
438                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
439                    match value {
440                        "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
441                        "SENT" => Some(Self::Sent),
442                        "RECEIVED" => Some(Self::Received),
443                        _ => None,
444                    }
445                }
446            }
447        }
448        impl ::prost::Name for MessageEvent {
449            const NAME: &'static str = "MessageEvent";
450            const PACKAGE: &'static str = "opencensus.proto.trace.v1";
451            fn full_name() -> ::prost::alloc::string::String {
452                "opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent".into()
453            }
454            fn type_url() -> ::prost::alloc::string::String {
455                "/opencensus.proto.trace.v1.Span.TimeEvent.MessageEvent".into()
456            }
457        }
458        /// A `TimeEvent` can contain either an `Annotation` object or a
459        /// `MessageEvent` object, but not both.
460        #[derive(Clone, PartialEq, ::prost::Oneof)]
461        pub enum Value {
462            /// A text annotation with a set of attributes.
463            #[prost(message, tag = "2")]
464            Annotation(Annotation),
465            /// An event describing a message sent/received between Spans.
466            #[prost(message, tag = "3")]
467            MessageEvent(MessageEvent),
468        }
469    }
470    impl ::prost::Name for TimeEvent {
471        const NAME: &'static str = "TimeEvent";
472        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
473        fn full_name() -> ::prost::alloc::string::String {
474            "opencensus.proto.trace.v1.Span.TimeEvent".into()
475        }
476        fn type_url() -> ::prost::alloc::string::String {
477            "/opencensus.proto.trace.v1.Span.TimeEvent".into()
478        }
479    }
480    /// A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
481    /// on the span, consisting of either user-supplied key-value pairs, or
482    /// details of a message sent/received between Spans.
483    #[derive(Clone, PartialEq, ::prost::Message)]
484    pub struct TimeEvents {
485        /// A collection of `TimeEvent`s.
486        #[prost(message, repeated, tag = "1")]
487        pub time_event: ::prost::alloc::vec::Vec<TimeEvent>,
488        /// The number of dropped annotations in all the included time events.
489        /// If the value is 0, then no annotations were dropped.
490        #[prost(int32, tag = "2")]
491        pub dropped_annotations_count: i32,
492        /// The number of dropped message events in all the included time events.
493        /// If the value is 0, then no message events were dropped.
494        #[prost(int32, tag = "3")]
495        pub dropped_message_events_count: i32,
496    }
497    impl ::prost::Name for TimeEvents {
498        const NAME: &'static str = "TimeEvents";
499        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
500        fn full_name() -> ::prost::alloc::string::String {
501            "opencensus.proto.trace.v1.Span.TimeEvents".into()
502        }
503        fn type_url() -> ::prost::alloc::string::String {
504            "/opencensus.proto.trace.v1.Span.TimeEvents".into()
505        }
506    }
507    /// A pointer from the current span to another span in the same trace or in a
508    /// different trace. For example, this can be used in batching operations,
509    /// where a single batch handler processes multiple requests from different
510    /// traces or when the handler receives a request from a different project.
511    #[derive(Clone, PartialEq, ::prost::Message)]
512    pub struct Link {
513        /// A unique identifier of a trace that this linked span is part of. The ID is a
514        /// 16-byte array.
515        #[prost(bytes = "vec", tag = "1")]
516        pub trace_id: ::prost::alloc::vec::Vec<u8>,
517        /// A unique identifier for the linked span. The ID is an 8-byte array.
518        #[prost(bytes = "vec", tag = "2")]
519        pub span_id: ::prost::alloc::vec::Vec<u8>,
520        /// The relationship of the current span relative to the linked span.
521        #[prost(enumeration = "link::Type", tag = "3")]
522        pub r#type: i32,
523        /// A set of attributes on the link.
524        #[prost(message, optional, tag = "4")]
525        pub attributes: ::core::option::Option<Attributes>,
526        /// The Tracestate associated with the link.
527        #[prost(message, optional, tag = "5")]
528        pub tracestate: ::core::option::Option<Tracestate>,
529    }
530    /// Nested message and enum types in `Link`.
531    pub mod link {
532        /// The relationship of the current span relative to the linked span: child,
533        /// parent, or unspecified.
534        #[derive(
535            Clone,
536            Copy,
537            Debug,
538            PartialEq,
539            Eq,
540            Hash,
541            PartialOrd,
542            Ord,
543            ::prost::Enumeration
544        )]
545        #[repr(i32)]
546        pub enum Type {
547            /// The relationship of the two spans is unknown, or known but other
548            /// than parent-child.
549            Unspecified = 0,
550            /// The linked span is a child of the current span.
551            ChildLinkedSpan = 1,
552            /// The linked span is a parent of the current span.
553            ParentLinkedSpan = 2,
554        }
555        impl Type {
556            /// String value of the enum field names used in the ProtoBuf definition.
557            ///
558            /// The values are not transformed in any way and thus are considered stable
559            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
560            pub fn as_str_name(&self) -> &'static str {
561                match self {
562                    Self::Unspecified => "TYPE_UNSPECIFIED",
563                    Self::ChildLinkedSpan => "CHILD_LINKED_SPAN",
564                    Self::ParentLinkedSpan => "PARENT_LINKED_SPAN",
565                }
566            }
567            /// Creates an enum from field names used in the ProtoBuf definition.
568            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
569                match value {
570                    "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
571                    "CHILD_LINKED_SPAN" => Some(Self::ChildLinkedSpan),
572                    "PARENT_LINKED_SPAN" => Some(Self::ParentLinkedSpan),
573                    _ => None,
574                }
575            }
576        }
577    }
578    impl ::prost::Name for Link {
579        const NAME: &'static str = "Link";
580        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
581        fn full_name() -> ::prost::alloc::string::String {
582            "opencensus.proto.trace.v1.Span.Link".into()
583        }
584        fn type_url() -> ::prost::alloc::string::String {
585            "/opencensus.proto.trace.v1.Span.Link".into()
586        }
587    }
588    /// A collection of links, which are references from this span to a span
589    /// in the same or different trace.
590    #[derive(Clone, PartialEq, ::prost::Message)]
591    pub struct Links {
592        /// A collection of links.
593        #[prost(message, repeated, tag = "1")]
594        pub link: ::prost::alloc::vec::Vec<Link>,
595        /// The number of dropped links after the maximum size was enforced. If
596        /// this value is 0, then no links were dropped.
597        #[prost(int32, tag = "2")]
598        pub dropped_links_count: i32,
599    }
600    impl ::prost::Name for Links {
601        const NAME: &'static str = "Links";
602        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
603        fn full_name() -> ::prost::alloc::string::String {
604            "opencensus.proto.trace.v1.Span.Links".into()
605        }
606        fn type_url() -> ::prost::alloc::string::String {
607            "/opencensus.proto.trace.v1.Span.Links".into()
608        }
609    }
610    /// Type of span. Can be used to specify additional relationships between spans
611    /// in addition to a parent/child relationship.
612    #[derive(
613        Clone,
614        Copy,
615        Debug,
616        PartialEq,
617        Eq,
618        Hash,
619        PartialOrd,
620        Ord,
621        ::prost::Enumeration
622    )]
623    #[repr(i32)]
624    pub enum SpanKind {
625        /// Unspecified.
626        Unspecified = 0,
627        /// Indicates that the span covers server-side handling of an RPC or other
628        /// remote network request.
629        Server = 1,
630        /// Indicates that the span covers the client-side wrapper around an RPC or
631        /// other remote request.
632        Client = 2,
633    }
634    impl SpanKind {
635        /// String value of the enum field names used in the ProtoBuf definition.
636        ///
637        /// The values are not transformed in any way and thus are considered stable
638        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
639        pub fn as_str_name(&self) -> &'static str {
640            match self {
641                Self::Unspecified => "SPAN_KIND_UNSPECIFIED",
642                Self::Server => "SERVER",
643                Self::Client => "CLIENT",
644            }
645        }
646        /// Creates an enum from field names used in the ProtoBuf definition.
647        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
648            match value {
649                "SPAN_KIND_UNSPECIFIED" => Some(Self::Unspecified),
650                "SERVER" => Some(Self::Server),
651                "CLIENT" => Some(Self::Client),
652                _ => None,
653            }
654        }
655    }
656}
657impl ::prost::Name for Span {
658    const NAME: &'static str = "Span";
659    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
660    fn full_name() -> ::prost::alloc::string::String {
661        "opencensus.proto.trace.v1.Span".into()
662    }
663    fn type_url() -> ::prost::alloc::string::String {
664        "/opencensus.proto.trace.v1.Span".into()
665    }
666}
667/// The `Status` type defines a logical error model that is suitable for different
668/// programming environments, including REST APIs and RPC APIs. This proto's fields
669/// are a subset of those of
670/// [google.rpc.Status](<https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto>),
671/// which is used by [gRPC](<https://github.com/grpc>).
672#[derive(Clone, PartialEq, ::prost::Message)]
673pub struct Status {
674    /// The status code. This is optional field. It is safe to assume 0 (OK)
675    /// when not set.
676    #[prost(int32, tag = "1")]
677    pub code: i32,
678    /// A developer-facing error message, which should be in English.
679    #[prost(string, tag = "2")]
680    pub message: ::prost::alloc::string::String,
681}
682impl ::prost::Name for Status {
683    const NAME: &'static str = "Status";
684    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
685    fn full_name() -> ::prost::alloc::string::String {
686        "opencensus.proto.trace.v1.Status".into()
687    }
688    fn type_url() -> ::prost::alloc::string::String {
689        "/opencensus.proto.trace.v1.Status".into()
690    }
691}
692/// The value of an Attribute.
693#[derive(Clone, PartialEq, ::prost::Message)]
694pub struct AttributeValue {
695    /// The type of the value.
696    #[prost(oneof = "attribute_value::Value", tags = "1, 2, 3, 4")]
697    pub value: ::core::option::Option<attribute_value::Value>,
698}
699/// Nested message and enum types in `AttributeValue`.
700pub mod attribute_value {
701    /// The type of the value.
702    #[derive(Clone, PartialEq, ::prost::Oneof)]
703    pub enum Value {
704        /// A string up to 256 bytes long.
705        #[prost(message, tag = "1")]
706        StringValue(super::TruncatableString),
707        /// A 64-bit signed integer.
708        #[prost(int64, tag = "2")]
709        IntValue(i64),
710        /// A Boolean value represented by `true` or `false`.
711        #[prost(bool, tag = "3")]
712        BoolValue(bool),
713        /// A double value.
714        #[prost(double, tag = "4")]
715        DoubleValue(f64),
716    }
717}
718impl ::prost::Name for AttributeValue {
719    const NAME: &'static str = "AttributeValue";
720    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
721    fn full_name() -> ::prost::alloc::string::String {
722        "opencensus.proto.trace.v1.AttributeValue".into()
723    }
724    fn type_url() -> ::prost::alloc::string::String {
725        "/opencensus.proto.trace.v1.AttributeValue".into()
726    }
727}
728/// The call stack which originated this span.
729#[derive(Clone, PartialEq, ::prost::Message)]
730pub struct StackTrace {
731    /// Stack frames in this stack trace.
732    #[prost(message, optional, tag = "1")]
733    pub stack_frames: ::core::option::Option<stack_trace::StackFrames>,
734    /// The hash ID is used to conserve network bandwidth for duplicate
735    /// stack traces within a single trace.
736    ///
737    /// Often multiple spans will have identical stack traces.
738    /// The first occurrence of a stack trace should contain both
739    /// `stack_frames` and a value in `stack_trace_hash_id`.
740    ///
741    /// Subsequent spans within the same request can refer
742    /// to that stack trace by setting only `stack_trace_hash_id`.
743    ///
744    /// TODO: describe how to deal with the case where stack_trace_hash_id is
745    /// zero because it was not set.
746    #[prost(uint64, tag = "2")]
747    pub stack_trace_hash_id: u64,
748}
749/// Nested message and enum types in `StackTrace`.
750pub mod stack_trace {
751    /// A single stack frame in a stack trace.
752    #[derive(Clone, PartialEq, ::prost::Message)]
753    pub struct StackFrame {
754        /// The fully-qualified name that uniquely identifies the function or
755        /// method that is active in this frame.
756        #[prost(message, optional, tag = "1")]
757        pub function_name: ::core::option::Option<super::TruncatableString>,
758        /// An un-mangled function name, if `function_name` is
759        /// [mangled](<http://www.avabodh.com/cxxin/namemangling.html>). The name can
760        /// be fully qualified.
761        #[prost(message, optional, tag = "2")]
762        pub original_function_name: ::core::option::Option<super::TruncatableString>,
763        /// The name of the source file where the function call appears.
764        #[prost(message, optional, tag = "3")]
765        pub file_name: ::core::option::Option<super::TruncatableString>,
766        /// The line number in `file_name` where the function call appears.
767        #[prost(int64, tag = "4")]
768        pub line_number: i64,
769        /// The column number where the function call appears, if available.
770        /// This is important in JavaScript because of its anonymous functions.
771        #[prost(int64, tag = "5")]
772        pub column_number: i64,
773        /// The binary module from where the code was loaded.
774        #[prost(message, optional, tag = "6")]
775        pub load_module: ::core::option::Option<super::Module>,
776        /// The version of the deployed source code.
777        #[prost(message, optional, tag = "7")]
778        pub source_version: ::core::option::Option<super::TruncatableString>,
779    }
780    impl ::prost::Name for StackFrame {
781        const NAME: &'static str = "StackFrame";
782        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
783        fn full_name() -> ::prost::alloc::string::String {
784            "opencensus.proto.trace.v1.StackTrace.StackFrame".into()
785        }
786        fn type_url() -> ::prost::alloc::string::String {
787            "/opencensus.proto.trace.v1.StackTrace.StackFrame".into()
788        }
789    }
790    /// A collection of stack frames, which can be truncated.
791    #[derive(Clone, PartialEq, ::prost::Message)]
792    pub struct StackFrames {
793        /// Stack frames in this call stack.
794        #[prost(message, repeated, tag = "1")]
795        pub frame: ::prost::alloc::vec::Vec<StackFrame>,
796        /// The number of stack frames that were dropped because there
797        /// were too many stack frames.
798        /// If this value is 0, then no stack frames were dropped.
799        #[prost(int32, tag = "2")]
800        pub dropped_frames_count: i32,
801    }
802    impl ::prost::Name for StackFrames {
803        const NAME: &'static str = "StackFrames";
804        const PACKAGE: &'static str = "opencensus.proto.trace.v1";
805        fn full_name() -> ::prost::alloc::string::String {
806            "opencensus.proto.trace.v1.StackTrace.StackFrames".into()
807        }
808        fn type_url() -> ::prost::alloc::string::String {
809            "/opencensus.proto.trace.v1.StackTrace.StackFrames".into()
810        }
811    }
812}
813impl ::prost::Name for StackTrace {
814    const NAME: &'static str = "StackTrace";
815    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
816    fn full_name() -> ::prost::alloc::string::String {
817        "opencensus.proto.trace.v1.StackTrace".into()
818    }
819    fn type_url() -> ::prost::alloc::string::String {
820        "/opencensus.proto.trace.v1.StackTrace".into()
821    }
822}
823/// A description of a binary module.
824#[derive(Clone, PartialEq, ::prost::Message)]
825pub struct Module {
826    /// TODO: document the meaning of this field.
827    /// For example: main binary, kernel modules, and dynamic libraries
828    /// such as libc.so, sharedlib.so.
829    #[prost(message, optional, tag = "1")]
830    pub module: ::core::option::Option<TruncatableString>,
831    /// A unique identifier for the module, usually a hash of its
832    /// contents.
833    #[prost(message, optional, tag = "2")]
834    pub build_id: ::core::option::Option<TruncatableString>,
835}
836impl ::prost::Name for Module {
837    const NAME: &'static str = "Module";
838    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
839    fn full_name() -> ::prost::alloc::string::String {
840        "opencensus.proto.trace.v1.Module".into()
841    }
842    fn type_url() -> ::prost::alloc::string::String {
843        "/opencensus.proto.trace.v1.Module".into()
844    }
845}
846/// A string that might be shortened to a specified length.
847#[derive(Clone, PartialEq, ::prost::Message)]
848pub struct TruncatableString {
849    /// The shortened string. For example, if the original string was 500 bytes long and
850    /// the limit of the string was 128 bytes, then this value contains the first 128
851    /// bytes of the 500-byte string. Note that truncation always happens on a
852    /// character boundary, to ensure that a truncated string is still valid UTF-8.
853    /// Because it may contain multi-byte characters, the size of the truncated string
854    /// may be less than the truncation limit.
855    #[prost(string, tag = "1")]
856    pub value: ::prost::alloc::string::String,
857    /// The number of bytes removed from the original string. If this
858    /// value is 0, then the string was not shortened.
859    #[prost(int32, tag = "2")]
860    pub truncated_byte_count: i32,
861}
862impl ::prost::Name for TruncatableString {
863    const NAME: &'static str = "TruncatableString";
864    const PACKAGE: &'static str = "opencensus.proto.trace.v1";
865    fn full_name() -> ::prost::alloc::string::String {
866        "opencensus.proto.trace.v1.TruncatableString".into()
867    }
868    fn type_url() -> ::prost::alloc::string::String {
869        "/opencensus.proto.trace.v1.TruncatableString".into()
870    }
871}