opentelemetry_stackdriver/proto/devtools/cloudtrace/
v2.rs

1// This file is @generated by prost-build.
2/// A span represents a single operation within a trace. Spans can be
3/// nested to form a trace tree. Often, a trace contains a root span
4/// that describes the end-to-end latency, and one or more subspans for
5/// its sub-operations.
6///
7/// A trace can also contain multiple root spans, or none at all.
8/// Spans do not need to be contiguous. There might be
9/// gaps or overlaps between spans in a trace.
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct Span {
12    /// Required. The resource name of the span in the following format:
13    ///
14    ///   * `projects/\[PROJECT_ID\]/traces/\[TRACE_ID\]/spans/\[SPAN_ID\]`
15    ///
16    /// `\[TRACE_ID\]` is a unique identifier for a trace within a project;
17    /// it is a 32-character hexadecimal encoding of a 16-byte array. It should
18    /// not be zero.
19    ///
20    /// `\[SPAN_ID\]` is a unique identifier for a span within a trace; it
21    /// is a 16-character hexadecimal encoding of an 8-byte array. It should not
22    /// be zero.
23    /// .
24    #[prost(string, tag = "1")]
25    pub name: ::prost::alloc::string::String,
26    /// Required. The `\[SPAN_ID\]` portion of the span's resource name.
27    #[prost(string, tag = "2")]
28    pub span_id: ::prost::alloc::string::String,
29    /// The `\[SPAN_ID\]` of this span's parent span. If this is a root span,
30    /// then this field must be empty.
31    #[prost(string, tag = "3")]
32    pub parent_span_id: ::prost::alloc::string::String,
33    /// Required. A description of the span's operation (up to 128 bytes).
34    /// Cloud Trace displays the description in the
35    /// Cloud console.
36    /// For example, the display name can be a qualified method name or a file name
37    /// and a line number where the operation is called. A best practice is to use
38    /// the same display name within an application and at the same call point.
39    /// This makes it easier to correlate spans in different traces.
40    #[prost(message, optional, tag = "4")]
41    pub display_name: ::core::option::Option<TruncatableString>,
42    /// Required. The start time of the span. On the client side, this is the time
43    /// kept by the local machine where the span execution starts. On the server
44    /// side, this is the time when the server's application handler starts
45    /// running.
46    #[prost(message, optional, tag = "5")]
47    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
48    /// Required. The end time of the span. On the client side, this is the time
49    /// kept by the local machine where the span execution ends. On the server
50    /// side, this is the time when the server application handler stops running.
51    #[prost(message, optional, tag = "6")]
52    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
53    /// A set of attributes on the span. You can have up to 32 attributes per
54    /// span.
55    #[prost(message, optional, tag = "7")]
56    pub attributes: ::core::option::Option<span::Attributes>,
57    /// Stack trace captured at the start of the span.
58    #[prost(message, optional, tag = "8")]
59    pub stack_trace: ::core::option::Option<StackTrace>,
60    /// A set of time events. You can have up to 32 annotations and 128 message
61    /// events per span.
62    #[prost(message, optional, tag = "9")]
63    pub time_events: ::core::option::Option<span::TimeEvents>,
64    /// Links associated with the span. You can have up to 128 links per Span.
65    #[prost(message, optional, tag = "10")]
66    pub links: ::core::option::Option<span::Links>,
67    /// Optional. The final status for this span.
68    #[prost(message, optional, tag = "11")]
69    pub status: ::core::option::Option<super::super::super::rpc::Status>,
70    /// Optional. Set this parameter to indicate whether this span is in
71    /// the same process as its parent. If you do not set this parameter,
72    /// Trace is unable to take advantage of this helpful information.
73    #[prost(message, optional, tag = "12")]
74    pub same_process_as_parent_span: ::core::option::Option<bool>,
75    /// Optional. The number of child spans that were generated while this span
76    /// was active. If set, allows implementation to detect missing child spans.
77    #[prost(message, optional, tag = "13")]
78    pub child_span_count: ::core::option::Option<i32>,
79    /// Optional. Distinguishes between spans generated in a particular context.
80    /// For example, two spans with the same name may be distinguished using
81    /// `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call.
82    #[prost(enumeration = "span::SpanKind", tag = "14")]
83    pub span_kind: i32,
84}
85/// Nested message and enum types in `Span`.
86pub mod span {
87    /// A set of attributes as key-value pairs.
88    #[derive(Clone, PartialEq, ::prost::Message)]
89    pub struct Attributes {
90        /// A set of attributes. Each attribute's key can be up to 128 bytes
91        /// long. The value can be a string up to 256 bytes, a signed 64-bit integer,
92        /// or the boolean values `true` or `false`. For example:
93        ///
94        ///      "/instance_id": { "string_value": { "value": "my-instance" } }
95        ///      "/http/request_bytes": { "int_value": 300 }
96        ///      "abc.com/myattribute": { "bool_value": false }
97        #[prost(map = "string, message", tag = "1")]
98        pub attribute_map:
99            ::std::collections::HashMap<::prost::alloc::string::String, super::AttributeValue>,
100        /// The number of attributes that were discarded. Attributes can be discarded
101        /// because their keys are too long or because there are too many attributes.
102        /// If this value is 0 then all attributes are valid.
103        #[prost(int32, tag = "2")]
104        pub dropped_attributes_count: i32,
105    }
106    /// A time-stamped annotation or message event in the Span.
107    #[derive(Clone, PartialEq, ::prost::Message)]
108    pub struct TimeEvent {
109        /// The timestamp indicating the time the event occurred.
110        #[prost(message, optional, tag = "1")]
111        pub time: ::core::option::Option<::prost_types::Timestamp>,
112        /// A `TimeEvent` can contain either an `Annotation` object or a
113        /// `MessageEvent` object, but not both.
114        #[prost(oneof = "time_event::Value", tags = "2, 3")]
115        pub value: ::core::option::Option<time_event::Value>,
116    }
117    /// Nested message and enum types in `TimeEvent`.
118    pub mod time_event {
119        /// Text annotation with a set of attributes.
120        #[derive(Clone, PartialEq, ::prost::Message)]
121        pub struct Annotation {
122            /// A user-supplied message describing the event. The maximum length for
123            /// the description is 256 bytes.
124            #[prost(message, optional, tag = "1")]
125            pub description: ::core::option::Option<super::super::TruncatableString>,
126            /// A set of attributes on the annotation. You can have up to 4 attributes
127            /// per Annotation.
128            #[prost(message, optional, tag = "2")]
129            pub attributes: ::core::option::Option<super::Attributes>,
130        }
131        /// An event describing a message sent/received between Spans.
132        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
133        pub struct MessageEvent {
134            /// Type of MessageEvent. Indicates whether the message was sent or
135            /// received.
136            #[prost(enumeration = "message_event::Type", tag = "1")]
137            pub r#type: i32,
138            /// An identifier for the MessageEvent's message that can be used to match
139            /// `SENT` and `RECEIVED` MessageEvents.
140            #[prost(int64, tag = "2")]
141            pub id: i64,
142            /// The number of uncompressed bytes sent or received.
143            #[prost(int64, tag = "3")]
144            pub uncompressed_size_bytes: i64,
145            /// The number of compressed bytes sent or received. If missing, the
146            /// compressed size is assumed to be the same size as the uncompressed
147            /// size.
148            #[prost(int64, tag = "4")]
149            pub compressed_size_bytes: i64,
150        }
151        /// Nested message and enum types in `MessageEvent`.
152        pub mod message_event {
153            /// Indicates whether the message was sent or received.
154            #[derive(
155                Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration,
156            )]
157            #[repr(i32)]
158            pub enum Type {
159                /// Unknown event type.
160                Unspecified = 0,
161                /// Indicates a sent message.
162                Sent = 1,
163                /// Indicates a received message.
164                Received = 2,
165            }
166            impl Type {
167                /// String value of the enum field names used in the ProtoBuf definition.
168                ///
169                /// The values are not transformed in any way and thus are considered stable
170                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
171                pub fn as_str_name(&self) -> &'static str {
172                    match self {
173                        Self::Unspecified => "TYPE_UNSPECIFIED",
174                        Self::Sent => "SENT",
175                        Self::Received => "RECEIVED",
176                    }
177                }
178                /// Creates an enum from field names used in the ProtoBuf definition.
179                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
180                    match value {
181                        "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
182                        "SENT" => Some(Self::Sent),
183                        "RECEIVED" => Some(Self::Received),
184                        _ => None,
185                    }
186                }
187            }
188        }
189        /// A `TimeEvent` can contain either an `Annotation` object or a
190        /// `MessageEvent` object, but not both.
191        #[derive(Clone, PartialEq, ::prost::Oneof)]
192        pub enum Value {
193            /// Text annotation with a set of attributes.
194            #[prost(message, tag = "2")]
195            Annotation(Annotation),
196            /// An event describing a message sent/received between Spans.
197            #[prost(message, tag = "3")]
198            MessageEvent(MessageEvent),
199        }
200    }
201    /// A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation
202    /// on the span, consisting of either user-supplied key:value pairs, or
203    /// details of a message sent/received between Spans.
204    #[derive(Clone, PartialEq, ::prost::Message)]
205    pub struct TimeEvents {
206        /// A collection of `TimeEvent`s.
207        #[prost(message, repeated, tag = "1")]
208        pub time_event: ::prost::alloc::vec::Vec<TimeEvent>,
209        /// The number of dropped annotations in all the included time events.
210        /// If the value is 0, then no annotations were dropped.
211        #[prost(int32, tag = "2")]
212        pub dropped_annotations_count: i32,
213        /// The number of dropped message events in all the included time events.
214        /// If the value is 0, then no message events were dropped.
215        #[prost(int32, tag = "3")]
216        pub dropped_message_events_count: i32,
217    }
218    /// A pointer from the current span to another span in the same trace or in a
219    /// different trace. For example, this can be used in batching operations,
220    /// where a single batch handler processes multiple requests from different
221    /// traces or when the handler receives a request from a different project.
222    #[derive(Clone, PartialEq, ::prost::Message)]
223    pub struct Link {
224        /// The `\[TRACE_ID\]` for a trace within a project.
225        #[prost(string, tag = "1")]
226        pub trace_id: ::prost::alloc::string::String,
227        /// The `\[SPAN_ID\]` for a span within a trace.
228        #[prost(string, tag = "2")]
229        pub span_id: ::prost::alloc::string::String,
230        /// The relationship of the current span relative to the linked span.
231        #[prost(enumeration = "link::Type", tag = "3")]
232        pub r#type: i32,
233        /// A set of attributes on the link. Up to 32 attributes can be
234        /// specified per link.
235        #[prost(message, optional, tag = "4")]
236        pub attributes: ::core::option::Option<Attributes>,
237    }
238    /// Nested message and enum types in `Link`.
239    pub mod link {
240        /// The relationship of the current span relative to the linked span: child,
241        /// parent, or unspecified.
242        #[derive(
243            Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration,
244        )]
245        #[repr(i32)]
246        pub enum Type {
247            /// The relationship of the two spans is unknown.
248            Unspecified = 0,
249            /// The linked span is a child of the current span.
250            ChildLinkedSpan = 1,
251            /// The linked span is a parent of the current span.
252            ParentLinkedSpan = 2,
253        }
254        impl Type {
255            /// String value of the enum field names used in the ProtoBuf definition.
256            ///
257            /// The values are not transformed in any way and thus are considered stable
258            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
259            pub fn as_str_name(&self) -> &'static str {
260                match self {
261                    Self::Unspecified => "TYPE_UNSPECIFIED",
262                    Self::ChildLinkedSpan => "CHILD_LINKED_SPAN",
263                    Self::ParentLinkedSpan => "PARENT_LINKED_SPAN",
264                }
265            }
266            /// Creates an enum from field names used in the ProtoBuf definition.
267            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
268                match value {
269                    "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
270                    "CHILD_LINKED_SPAN" => Some(Self::ChildLinkedSpan),
271                    "PARENT_LINKED_SPAN" => Some(Self::ParentLinkedSpan),
272                    _ => None,
273                }
274            }
275        }
276    }
277    /// A collection of links, which are references from this span to a span
278    /// in the same or different trace.
279    #[derive(Clone, PartialEq, ::prost::Message)]
280    pub struct Links {
281        /// A collection of links.
282        #[prost(message, repeated, tag = "1")]
283        pub link: ::prost::alloc::vec::Vec<Link>,
284        /// The number of dropped links after the maximum size was enforced. If
285        /// this value is 0, then no links were dropped.
286        #[prost(int32, tag = "2")]
287        pub dropped_links_count: i32,
288    }
289    /// Type of span. Can be used to specify additional relationships between spans
290    /// in addition to a parent/child relationship.
291    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
292    #[repr(i32)]
293    pub enum SpanKind {
294        /// Unspecified. Do NOT use as default.
295        /// Implementations MAY assume SpanKind.INTERNAL to be default.
296        Unspecified = 0,
297        /// Indicates that the span is used internally. Default value.
298        Internal = 1,
299        /// Indicates that the span covers server-side handling of an RPC or other
300        /// remote network request.
301        Server = 2,
302        /// Indicates that the span covers the client-side wrapper around an RPC or
303        /// other remote request.
304        Client = 3,
305        /// Indicates that the span describes producer sending a message to a broker.
306        /// Unlike client and  server, there is no direct critical path latency
307        /// relationship between producer and consumer spans (e.g. publishing a
308        /// message to a pubsub service).
309        Producer = 4,
310        /// Indicates that the span describes consumer receiving a message from a
311        /// broker. Unlike client and  server, there is no direct critical path
312        /// latency relationship between producer and consumer spans (e.g. receiving
313        /// a message from a pubsub service subscription).
314        Consumer = 5,
315    }
316    impl SpanKind {
317        /// String value of the enum field names used in the ProtoBuf definition.
318        ///
319        /// The values are not transformed in any way and thus are considered stable
320        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
321        pub fn as_str_name(&self) -> &'static str {
322            match self {
323                Self::Unspecified => "SPAN_KIND_UNSPECIFIED",
324                Self::Internal => "INTERNAL",
325                Self::Server => "SERVER",
326                Self::Client => "CLIENT",
327                Self::Producer => "PRODUCER",
328                Self::Consumer => "CONSUMER",
329            }
330        }
331        /// Creates an enum from field names used in the ProtoBuf definition.
332        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
333            match value {
334                "SPAN_KIND_UNSPECIFIED" => Some(Self::Unspecified),
335                "INTERNAL" => Some(Self::Internal),
336                "SERVER" => Some(Self::Server),
337                "CLIENT" => Some(Self::Client),
338                "PRODUCER" => Some(Self::Producer),
339                "CONSUMER" => Some(Self::Consumer),
340                _ => None,
341            }
342        }
343    }
344}
345/// The allowed types for `\[VALUE\]` in a `\[KEY\]:[VALUE]` attribute.
346#[derive(Clone, PartialEq, ::prost::Message)]
347pub struct AttributeValue {
348    /// The type of the value.
349    #[prost(oneof = "attribute_value::Value", tags = "1, 2, 3")]
350    pub value: ::core::option::Option<attribute_value::Value>,
351}
352/// Nested message and enum types in `AttributeValue`.
353pub mod attribute_value {
354    /// The type of the value.
355    #[derive(Clone, PartialEq, ::prost::Oneof)]
356    pub enum Value {
357        /// A string up to 256 bytes long.
358        #[prost(message, tag = "1")]
359        StringValue(super::TruncatableString),
360        /// A 64-bit signed integer.
361        #[prost(int64, tag = "2")]
362        IntValue(i64),
363        /// A Boolean value represented by `true` or `false`.
364        #[prost(bool, tag = "3")]
365        BoolValue(bool),
366    }
367}
368/// A call stack appearing in a trace.
369#[derive(Clone, PartialEq, ::prost::Message)]
370pub struct StackTrace {
371    /// Stack frames in this stack trace. A maximum of 128 frames are allowed.
372    #[prost(message, optional, tag = "1")]
373    pub stack_frames: ::core::option::Option<stack_trace::StackFrames>,
374    /// The hash ID is used to conserve network bandwidth for duplicate
375    /// stack traces within a single trace.
376    ///
377    /// Often multiple spans will have identical stack traces.
378    /// The first occurrence of a stack trace should contain both the
379    /// `stackFrame` content and a value in `stackTraceHashId`.
380    ///
381    /// Subsequent spans within the same request can refer
382    /// to that stack trace by only setting `stackTraceHashId`.
383    #[prost(int64, tag = "2")]
384    pub stack_trace_hash_id: i64,
385}
386/// Nested message and enum types in `StackTrace`.
387pub mod stack_trace {
388    /// Represents a single stack frame in a stack trace.
389    #[derive(Clone, PartialEq, ::prost::Message)]
390    pub struct StackFrame {
391        /// The fully-qualified name that uniquely identifies the function or
392        /// method that is active in this frame (up to 1024 bytes).
393        #[prost(message, optional, tag = "1")]
394        pub function_name: ::core::option::Option<super::TruncatableString>,
395        /// An un-mangled function name, if `function_name` is mangled.
396        /// To get information about name mangling, run
397        /// [this search](<https://www.google.com/search?q=cxx+name+mangling>).
398        /// The name can be fully-qualified (up to 1024 bytes).
399        #[prost(message, optional, tag = "2")]
400        pub original_function_name: ::core::option::Option<super::TruncatableString>,
401        /// The name of the source file where the function call appears (up to 256
402        /// bytes).
403        #[prost(message, optional, tag = "3")]
404        pub file_name: ::core::option::Option<super::TruncatableString>,
405        /// The line number in `file_name` where the function call appears.
406        #[prost(int64, tag = "4")]
407        pub line_number: i64,
408        /// The column number where the function call appears, if available.
409        /// This is important in JavaScript because of its anonymous functions.
410        #[prost(int64, tag = "5")]
411        pub column_number: i64,
412        /// The binary module from where the code was loaded.
413        #[prost(message, optional, tag = "6")]
414        pub load_module: ::core::option::Option<super::Module>,
415        /// The version of the deployed source code (up to 128 bytes).
416        #[prost(message, optional, tag = "7")]
417        pub source_version: ::core::option::Option<super::TruncatableString>,
418    }
419    /// A collection of stack frames, which can be truncated.
420    #[derive(Clone, PartialEq, ::prost::Message)]
421    pub struct StackFrames {
422        /// Stack frames in this call stack.
423        #[prost(message, repeated, tag = "1")]
424        pub frame: ::prost::alloc::vec::Vec<StackFrame>,
425        /// The number of stack frames that were dropped because there
426        /// were too many stack frames.
427        /// If this value is 0, then no stack frames were dropped.
428        #[prost(int32, tag = "2")]
429        pub dropped_frames_count: i32,
430    }
431}
432/// Binary module.
433#[derive(Clone, PartialEq, ::prost::Message)]
434pub struct Module {
435    /// For example: main binary, kernel modules, and dynamic libraries
436    /// such as libc.so, sharedlib.so (up to 256 bytes).
437    #[prost(message, optional, tag = "1")]
438    pub module: ::core::option::Option<TruncatableString>,
439    /// A unique identifier for the module, usually a hash of its
440    /// contents (up to 128 bytes).
441    #[prost(message, optional, tag = "2")]
442    pub build_id: ::core::option::Option<TruncatableString>,
443}
444/// Represents a string that might be shortened to a specified length.
445#[derive(Clone, PartialEq, ::prost::Message)]
446pub struct TruncatableString {
447    /// The shortened string. For example, if the original string is 500
448    /// bytes long and the limit of the string is 128 bytes, then
449    /// `value` contains the first 128 bytes of the 500-byte string.
450    ///
451    /// Truncation always happens on a UTF8 character boundary. If there
452    /// are multi-byte characters in the string, then the length of the
453    /// shortened string might be less than the size limit.
454    #[prost(string, tag = "1")]
455    pub value: ::prost::alloc::string::String,
456    /// The number of bytes removed from the original string. If this
457    /// value is 0, then the string was not shortened.
458    #[prost(int32, tag = "2")]
459    pub truncated_byte_count: i32,
460}
461/// The request message for the `BatchWriteSpans` method.
462#[derive(Clone, PartialEq, ::prost::Message)]
463pub struct BatchWriteSpansRequest {
464    /// Required. The name of the project where the spans belong. The format is
465    /// `projects/\[PROJECT_ID\]`.
466    #[prost(string, tag = "1")]
467    pub name: ::prost::alloc::string::String,
468    /// Required. A list of new spans. The span names must not match existing
469    /// spans, otherwise the results are undefined.
470    #[prost(message, repeated, tag = "2")]
471    pub spans: ::prost::alloc::vec::Vec<Span>,
472}
473/// Generated client implementations.
474pub mod trace_service_client {
475    #![allow(
476        unused_variables,
477        dead_code,
478        missing_docs,
479        clippy::wildcard_imports,
480        clippy::let_unit_value
481    )]
482    use tonic::codegen::http::Uri;
483    use tonic::codegen::*;
484    /// Service for collecting and viewing traces and spans within a trace.
485    ///
486    /// A trace is a collection of spans corresponding to a single
487    /// operation or a set of operations in an application.
488    ///
489    /// A span is an individual timed event which forms a node of the trace tree.
490    /// A single trace can contain spans from multiple services.
491    #[derive(Debug, Clone)]
492    pub struct TraceServiceClient<T> {
493        inner: tonic::client::Grpc<T>,
494    }
495    impl TraceServiceClient<tonic::transport::Channel> {
496        /// Attempt to create a new client by connecting to a given endpoint.
497        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
498        where
499            D: TryInto<tonic::transport::Endpoint>,
500            D::Error: Into<StdError>,
501        {
502            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
503            Ok(Self::new(conn))
504        }
505    }
506    impl<T> TraceServiceClient<T>
507    where
508        T: tonic::client::GrpcService<tonic::body::Body>,
509        T::Error: Into<StdError>,
510        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
511        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
512    {
513        pub fn new(inner: T) -> Self {
514            let inner = tonic::client::Grpc::new(inner);
515            Self { inner }
516        }
517        pub fn with_origin(inner: T, origin: Uri) -> Self {
518            let inner = tonic::client::Grpc::with_origin(inner, origin);
519            Self { inner }
520        }
521        pub fn with_interceptor<F>(
522            inner: T,
523            interceptor: F,
524        ) -> TraceServiceClient<InterceptedService<T, F>>
525        where
526            F: tonic::service::Interceptor,
527            T::ResponseBody: Default,
528            T: tonic::codegen::Service<
529                http::Request<tonic::body::Body>,
530                Response = http::Response<
531                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
532                >,
533            >,
534            <T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
535                Into<StdError> + std::marker::Send + std::marker::Sync,
536        {
537            TraceServiceClient::new(InterceptedService::new(inner, interceptor))
538        }
539        /// Compress requests with the given encoding.
540        ///
541        /// This requires the server to support it otherwise it might respond with an
542        /// error.
543        #[must_use]
544        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
545            self.inner = self.inner.send_compressed(encoding);
546            self
547        }
548        /// Enable decompressing responses.
549        #[must_use]
550        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
551            self.inner = self.inner.accept_compressed(encoding);
552            self
553        }
554        /// Limits the maximum size of a decoded message.
555        ///
556        /// Default: `4MB`
557        #[must_use]
558        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
559            self.inner = self.inner.max_decoding_message_size(limit);
560            self
561        }
562        /// Limits the maximum size of an encoded message.
563        ///
564        /// Default: `usize::MAX`
565        #[must_use]
566        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
567            self.inner = self.inner.max_encoding_message_size(limit);
568            self
569        }
570        /// Batch writes new spans to new or existing traces. You cannot update
571        /// existing spans.
572        pub async fn batch_write_spans(
573            &mut self,
574            request: impl tonic::IntoRequest<super::BatchWriteSpansRequest>,
575        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
576            self.inner.ready().await.map_err(|e| {
577                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
578            })?;
579            let codec = tonic::codec::ProstCodec::default();
580            let path = http::uri::PathAndQuery::from_static(
581                "/google.devtools.cloudtrace.v2.TraceService/BatchWriteSpans",
582            );
583            let mut req = request.into_request();
584            req.extensions_mut().insert(GrpcMethod::new(
585                "google.devtools.cloudtrace.v2.TraceService",
586                "BatchWriteSpans",
587            ));
588            self.inner.unary(req, path, codec).await
589        }
590        /// Creates a new span.
591        pub async fn create_span(
592            &mut self,
593            request: impl tonic::IntoRequest<super::Span>,
594        ) -> std::result::Result<tonic::Response<super::Span>, tonic::Status> {
595            self.inner.ready().await.map_err(|e| {
596                tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
597            })?;
598            let codec = tonic::codec::ProstCodec::default();
599            let path = http::uri::PathAndQuery::from_static(
600                "/google.devtools.cloudtrace.v2.TraceService/CreateSpan",
601            );
602            let mut req = request.into_request();
603            req.extensions_mut().insert(GrpcMethod::new(
604                "google.devtools.cloudtrace.v2.TraceService",
605                "CreateSpan",
606            ));
607            self.inner.unary(req, path, codec).await
608        }
609    }
610}