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