Skip to main content

libdd_trace_protobuf/
pb.rs

1// Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/
2// SPDX-License-Identifier: Apache-2.0
3
4use serde::{Deserialize, Serialize};
5// This file is @generated by prost-build.
6#[derive(Deserialize, Serialize)]
7#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct SpanLink {
10    /// @gotags: json:"trace_id" msg:"trace_id"
11    ///
12    /// Required.
13    #[prost(uint64, tag = "1")]
14    pub trace_id: u64,
15    /// @gotags: json:"trace_id_high" msg:"trace_id_high,omitempty"
16    ///
17    /// Optional. The high 64 bits of a referenced trace id.
18    #[prost(uint64, tag = "2")]
19    #[serde(default)]
20    pub trace_id_high: u64,
21    /// @gotags: json:"span_id" msg:"span_id"
22    ///
23    /// Required.
24    #[prost(uint64, tag = "3")]
25    pub span_id: u64,
26    /// @gotags: msg:"attributes,omitempty"
27    ///
28    /// Optional. Simple mapping of keys to string values.
29    #[prost(map = "string, string", tag = "4")]
30    #[serde(default)]
31    pub attributes: ::std::collections::HashMap<
32        ::prost::alloc::string::String,
33        ::prost::alloc::string::String,
34    >,
35    /// @gotags: msg:"tracestate,omitempty"
36    ///
37    /// Optional. W3C tracestate.
38    #[prost(string, tag = "5")]
39    #[serde(default)]
40    pub tracestate: ::prost::alloc::string::String,
41    /// @gotags: msg:"flags,omitempty"
42    ///
43    /// Optional. W3C trace flags. If set, the high bit (bit 31) must be set.
44    #[prost(uint32, tag = "6")]
45    #[serde(default)]
46    pub flags: u32,
47}
48#[derive(Deserialize, Serialize)]
49#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct SpanEvent {
52    /// @gotags: json:"time_unix_nano" msg:"time_unix_nano"
53    ///
54    /// time is the number of nanoseconds between the Unix epoch and this event.
55    #[prost(fixed64, tag = "1")]
56    #[serde(default)]
57    pub time_unix_nano: u64,
58    /// @gotags: json:"name" msg:"name"
59    ///
60    /// name is this event's name.
61    #[prost(string, tag = "2")]
62    #[serde(default)]
63    pub name: ::prost::alloc::string::String,
64    /// attributes is a mapping from attribute key string to any value.
65    /// The order of attributes should be preserved in the key/value map.
66    /// The supported values match the OpenTelemetry attributes specification:
67    /// <https://github.com/open-telemetry/opentelemetry-proto/blob/a8f08fc49d60538f97ffabcc7feac92f832976dd/opentelemetry/proto/common/v1/common.proto>
68    /// @gotags: json:"attributes" msg:"attributes"
69    #[prost(map = "string, message", tag = "3")]
70    #[serde(default)]
71    pub attributes: ::std::collections::HashMap<
72        ::prost::alloc::string::String,
73        AttributeAnyValue,
74    >,
75}
76/// AttributeAnyValue is used to represent any type of attribute value. AttributeAnyValue may contain a
77/// primitive value such as a string or integer or it may contain an arbitrary nested
78/// object containing arrays, key-value lists and primitives.
79#[derive(Deserialize, Serialize)]
80#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
81#[derive(Clone, PartialEq, ::prost::Message)]
82pub struct AttributeAnyValue {
83    /// We implement a union manually here because Go's MessagePack generator does not support
84    /// Protobuf `oneof` unions: <https://github.com/tinylib/msgp/issues/184>
85    /// Despite this, the format represented here is binary compatible with `oneof`, if we choose
86    /// to migrate to that in the future.
87    /// @gotags: json:"type" msg:"type"
88    #[prost(enumeration = "attribute_any_value::AttributeAnyValueType", tag = "1")]
89    #[serde(default)]
90    pub r#type: i32,
91    /// @gotags: json:"string_value" msg:"string_value"
92    #[prost(string, tag = "2")]
93    #[serde(default)]
94    pub string_value: ::prost::alloc::string::String,
95    /// @gotags: json:"bool_value" msg:"bool_value"
96    #[prost(bool, tag = "3")]
97    #[serde(default)]
98    pub bool_value: bool,
99    /// @gotags: json:"int_value" msg:"int_value"
100    #[prost(int64, tag = "4")]
101    #[serde(default)]
102    pub int_value: i64,
103    /// @gotags: json:"double_value" msg:"double_value"
104    #[prost(double, tag = "5")]
105    #[serde(default)]
106    pub double_value: f64,
107    /// @gotags: json:"array_value" msg:"array_value"
108    #[prost(message, optional, tag = "6")]
109    #[serde(default)]
110    pub array_value: ::core::option::Option<AttributeArray>,
111}
112/// Nested message and enum types in `AttributeAnyValue`.
113pub mod attribute_any_value {
114    #[derive(
115        Clone,
116        Copy,
117        Debug,
118        PartialEq,
119        Eq,
120        Hash,
121        PartialOrd,
122        Ord,
123        ::prost::Enumeration
124    )]
125    #[repr(i32)]
126    pub enum AttributeAnyValueType {
127        StringValue = 0,
128        BoolValue = 1,
129        IntValue = 2,
130        DoubleValue = 3,
131        ArrayValue = 4,
132    }
133    impl AttributeAnyValueType {
134        /// String value of the enum field names used in the ProtoBuf definition.
135        ///
136        /// The values are not transformed in any way and thus are considered stable
137        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
138        pub fn as_str_name(&self) -> &'static str {
139            match self {
140                Self::StringValue => "STRING_VALUE",
141                Self::BoolValue => "BOOL_VALUE",
142                Self::IntValue => "INT_VALUE",
143                Self::DoubleValue => "DOUBLE_VALUE",
144                Self::ArrayValue => "ARRAY_VALUE",
145            }
146        }
147        /// Creates an enum from field names used in the ProtoBuf definition.
148        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
149            match value {
150                "STRING_VALUE" => Some(Self::StringValue),
151                "BOOL_VALUE" => Some(Self::BoolValue),
152                "INT_VALUE" => Some(Self::IntValue),
153                "DOUBLE_VALUE" => Some(Self::DoubleValue),
154                "ARRAY_VALUE" => Some(Self::ArrayValue),
155                _ => None,
156            }
157        }
158    }
159}
160/// AttributeArray is a list of AttributeArrayValue messages. We need this as a message since `oneof` in AttributeAnyValue does not allow repeated fields.
161#[derive(Deserialize, Serialize)]
162#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct AttributeArray {
165    /// Array of values. The array may be empty (contain 0 elements).
166    /// @gotags: json:"values" msg:"values"
167    #[prost(message, repeated, tag = "1")]
168    #[serde(default)]
169    pub values: ::prost::alloc::vec::Vec<AttributeArrayValue>,
170}
171/// An element in the homogeneous AttributeArray.
172/// Compared to AttributeAnyValue, it only supports scalar values.
173#[derive(Deserialize, Serialize)]
174#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct AttributeArrayValue {
177    /// We implement a union manually here because Go's MessagePack generator does not support
178    /// Protobuf `oneof` unions: <https://github.com/tinylib/msgp/issues/184>
179    /// Despite this, the format represented here is binary compatible with `oneof`, if we choose
180    /// to migrate to that in the future.
181    /// @gotags: json:"type" msg:"type"
182    #[prost(enumeration = "attribute_array_value::AttributeArrayValueType", tag = "1")]
183    #[serde(default)]
184    pub r#type: i32,
185    /// @gotags: json:"string_value" msg:"string_value"
186    #[prost(string, tag = "2")]
187    #[serde(default)]
188    pub string_value: ::prost::alloc::string::String,
189    /// @gotags: json:"bool_value" msg:"bool_value"
190    #[prost(bool, tag = "3")]
191    #[serde(default)]
192    pub bool_value: bool,
193    /// @gotags: json:"int_value" msg:"int_value"
194    #[prost(int64, tag = "4")]
195    #[serde(default)]
196    pub int_value: i64,
197    /// @gotags: json:"double_value" msg:"double_value"
198    #[prost(double, tag = "5")]
199    #[serde(default)]
200    pub double_value: f64,
201}
202/// Nested message and enum types in `AttributeArrayValue`.
203pub mod attribute_array_value {
204    #[derive(
205        Clone,
206        Copy,
207        Debug,
208        PartialEq,
209        Eq,
210        Hash,
211        PartialOrd,
212        Ord,
213        ::prost::Enumeration
214    )]
215    #[repr(i32)]
216    pub enum AttributeArrayValueType {
217        StringValue = 0,
218        BoolValue = 1,
219        IntValue = 2,
220        DoubleValue = 3,
221    }
222    impl AttributeArrayValueType {
223        /// String value of the enum field names used in the ProtoBuf definition.
224        ///
225        /// The values are not transformed in any way and thus are considered stable
226        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
227        pub fn as_str_name(&self) -> &'static str {
228            match self {
229                Self::StringValue => "STRING_VALUE",
230                Self::BoolValue => "BOOL_VALUE",
231                Self::IntValue => "INT_VALUE",
232                Self::DoubleValue => "DOUBLE_VALUE",
233            }
234        }
235        /// Creates an enum from field names used in the ProtoBuf definition.
236        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
237            match value {
238                "STRING_VALUE" => Some(Self::StringValue),
239                "BOOL_VALUE" => Some(Self::BoolValue),
240                "INT_VALUE" => Some(Self::IntValue),
241                "DOUBLE_VALUE" => Some(Self::DoubleValue),
242                _ => None,
243            }
244        }
245    }
246}
247#[derive(Deserialize, Serialize)]
248#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
249#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct Span {
251    /// service is the name of the service with which this span is associated.
252    /// @gotags: json:"service" msg:"service"
253    #[prost(string, tag = "1")]
254    #[serde(default)]
255    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
256    pub service: ::prost::alloc::string::String,
257    /// name is the operation name of this span.
258    /// @gotags: json:"name" msg:"name"
259    #[prost(string, tag = "2")]
260    #[serde(default)]
261    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
262    pub name: ::prost::alloc::string::String,
263    /// resource is the resource name of this span, also sometimes called the endpoint (for web spans).
264    /// @gotags: json:"resource" msg:"resource"
265    #[prost(string, tag = "3")]
266    #[serde(default)]
267    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
268    pub resource: ::prost::alloc::string::String,
269    /// traceID is the ID of the trace to which this span belongs.
270    /// @gotags: json:"trace_id" msg:"trace_id"
271    #[prost(uint64, tag = "4")]
272    #[serde(default)]
273    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
274    pub trace_id: u64,
275    /// spanID is the ID of this span.
276    /// @gotags: json:"span_id" msg:"span_id"
277    #[prost(uint64, tag = "5")]
278    #[serde(default)]
279    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
280    pub span_id: u64,
281    /// parentID is the ID of this span's parent, or zero if this span has no parent.
282    /// @gotags: json:"parent_id" msg:"parent_id"
283    #[prost(uint64, tag = "6")]
284    #[serde(default)]
285    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
286    pub parent_id: u64,
287    /// start is the number of nanoseconds between the Unix epoch and the beginning of this span.
288    /// @gotags: json:"start" msg:"start"
289    #[prost(int64, tag = "7")]
290    #[serde(default)]
291    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
292    pub start: i64,
293    /// duration is the time length of this span in nanoseconds.
294    /// @gotags: json:"duration" msg:"duration"
295    #[prost(int64, tag = "8")]
296    #[serde(default)]
297    #[serde(deserialize_with = "crate::deserializers::deserialize_duration")]
298    pub duration: i64,
299    /// error is 1 if there is an error associated with this span, or 0 if there is not.
300    /// @gotags: json:"error" msg:"error"
301    #[prost(int32, tag = "9")]
302    #[serde(default)]
303    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
304    #[serde(skip_serializing_if = "crate::deserializers::is_default")]
305    pub error: i32,
306    /// meta is a mapping from tag name to tag value for string-valued tags.
307    /// @gotags: json:"meta,omitempty" msg:"meta,omitempty"
308    #[prost(map = "string, string", tag = "10")]
309    #[serde(default)]
310    #[serde(
311        deserialize_with = "crate::deserializers::deserialize_map_with_nullable_values"
312    )]
313    pub meta: ::std::collections::HashMap<
314        ::prost::alloc::string::String,
315        ::prost::alloc::string::String,
316    >,
317    /// metrics is a mapping from tag name to tag value for numeric-valued tags.
318    /// @gotags: json:"metrics,omitempty" msg:"metrics,omitempty"
319    #[prost(map = "string, double", tag = "11")]
320    #[serde(default)]
321    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
322    pub metrics: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
323    /// type is the type of the service with which this span is associated.  Example values: web, db, lambda.
324    /// @gotags: json:"type" msg:"type"
325    #[prost(string, tag = "12")]
326    #[serde(default)]
327    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
328    pub r#type: ::prost::alloc::string::String,
329    /// meta_struct is a registry of structured "other" data used by, e.g., AppSec.
330    /// Entries can legitimately be much larger than other span fields, so this
331    /// field overrides the package-wide messagepack allocation limit with a 10MiB
332    /// cap (see the //msgp:limit directives in pkg/proto/pbgo/trace).
333    /// @gotags: json:"meta_struct,omitempty" msg:"meta_struct,omitempty,limit=10485760"
334    #[prost(map = "string, bytes", tag = "13")]
335    #[serde(default)]
336    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
337    #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty")]
338    pub meta_struct: ::std::collections::HashMap<
339        ::prost::alloc::string::String,
340        ::prost::alloc::vec::Vec<u8>,
341    >,
342    /// span_links represents a collection of links, where each link defines a causal relationship between two spans.
343    /// @gotags: json:"span_links,omitempty" msg:"span_links,omitempty"
344    #[prost(message, repeated, tag = "14")]
345    #[serde(default)]
346    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
347    #[serde(skip_serializing_if = "::prost::alloc::vec::Vec::is_empty")]
348    pub span_links: ::prost::alloc::vec::Vec<SpanLink>,
349    /// spanEvents represent an event at an instant in time related to this span, but not necessarily during the span.
350    /// @gotags: json:"span_events,omitempty" msg:"span_events,omitempty"
351    #[prost(message, repeated, tag = "15")]
352    #[serde(default)]
353    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
354    #[serde(skip_serializing_if = "::prost::alloc::vec::Vec::is_empty")]
355    pub span_events: ::prost::alloc::vec::Vec<SpanEvent>,
356}
357/// TraceChunk represents a list of spans with the same trace ID. In other words, a chunk of a trace.
358#[derive(Deserialize, Serialize)]
359#[derive(Clone, PartialEq, ::prost::Message)]
360pub struct TraceChunk {
361    /// priority specifies sampling priority of the trace.
362    /// @gotags: json:"priority" msg:"priority"
363    #[prost(int32, tag = "1")]
364    pub priority: i32,
365    /// origin specifies origin product ("lambda", "rum", etc.) of the trace.
366    /// @gotags: json:"origin" msg:"origin"
367    #[prost(string, tag = "2")]
368    pub origin: ::prost::alloc::string::String,
369    /// spans specifies list of containing spans.
370    /// @gotags: json:"spans" msg:"spans"
371    #[prost(message, repeated, tag = "3")]
372    pub spans: ::prost::alloc::vec::Vec<Span>,
373    /// tags specifies tags common in all `spans`.
374    /// @gotags: json:"tags" msg:"tags"
375    #[prost(map = "string, string", tag = "4")]
376    pub tags: ::std::collections::HashMap<
377        ::prost::alloc::string::String,
378        ::prost::alloc::string::String,
379    >,
380    /// droppedTrace specifies whether the trace was dropped by samplers or not.
381    /// @gotags: json:"dropped_trace" msg:"dropped_trace"
382    #[prost(bool, tag = "5")]
383    pub dropped_trace: bool,
384}
385/// TracerPayload represents a payload the trace agent receives from tracers.
386#[derive(Deserialize, Serialize)]
387#[derive(Clone, PartialEq, ::prost::Message)]
388pub struct TracerPayload {
389    /// containerID specifies the ID of the container where the tracer is running on.
390    /// @gotags: json:"container_id" msg:"container_id"
391    #[prost(string, tag = "1")]
392    pub container_id: ::prost::alloc::string::String,
393    /// languageName specifies language of the tracer.
394    /// @gotags: json:"language_name" msg:"language_name"
395    #[prost(string, tag = "2")]
396    pub language_name: ::prost::alloc::string::String,
397    /// languageVersion specifies language version of the tracer.
398    /// @gotags: json:"language_version" msg:"language_version"
399    #[prost(string, tag = "3")]
400    pub language_version: ::prost::alloc::string::String,
401    /// tracerVersion specifies version of the tracer.
402    /// @gotags: json:"tracer_version" msg:"tracer_version"
403    #[prost(string, tag = "4")]
404    pub tracer_version: ::prost::alloc::string::String,
405    /// runtimeID specifies V4 UUID representation of a tracer session.
406    /// @gotags: json:"runtime_id" msg:"runtime_id"
407    #[prost(string, tag = "5")]
408    pub runtime_id: ::prost::alloc::string::String,
409    /// chunks specifies list of containing trace chunks.
410    /// @gotags: json:"chunks" msg:"chunks"
411    #[prost(message, repeated, tag = "6")]
412    pub chunks: ::prost::alloc::vec::Vec<TraceChunk>,
413    /// tags specifies tags common in all `chunks`.
414    /// @gotags: json:"tags" msg:"tags"
415    #[prost(map = "string, string", tag = "7")]
416    pub tags: ::std::collections::HashMap<
417        ::prost::alloc::string::String,
418        ::prost::alloc::string::String,
419    >,
420    /// env specifies `env` tag that set with the tracer.
421    /// @gotags: json:"env" msg:"env"
422    #[prost(string, tag = "8")]
423    pub env: ::prost::alloc::string::String,
424    /// hostname specifies hostname of where the tracer is running.
425    /// @gotags: json:"hostname" msg:"hostname"
426    #[prost(string, tag = "9")]
427    pub hostname: ::prost::alloc::string::String,
428    /// version specifies `version` tag that set with the tracer.
429    /// @gotags: json:"app_version" msg:"app_version"
430    #[prost(string, tag = "10")]
431    pub app_version: ::prost::alloc::string::String,
432    /// containerDebug holds debug information about the container tags resolution.
433    /// @gotags: json:"container_debug,omitempty" msg:"container_debug,omitempty"
434    #[prost(message, optional, tag = "11")]
435    #[serde(skip_serializing_if = "Option::is_none")]
436    pub container_debug: ::core::option::Option<ContainerDebug>,
437}
438/// ContainerDebug holds debug information about the container tags resolution process.
439#[derive(Deserialize, Serialize, PartialOrd, Ord)]
440#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
441pub struct ContainerDebug {
442    /// error specifies any error that occurred during container tag resolution.
443    /// @gotags: json:"error,omitempty" msg:"error,omitempty"
444    #[prost(string, tag = "1")]
445    #[serde(default)]
446    pub error: ::prost::alloc::string::String,
447    /// latencyMs specifies the latency in milliseconds of the container tag resolution.
448    /// @gotags: json:"latency_ms,omitempty" msg:"latency_ms,omitempty"
449    #[prost(int64, tag = "2")]
450    #[serde(default)]
451    pub latency_ms: i64,
452    /// wasBuffered specifies whether the payload was buffered while waiting for container tags.
453    /// @gotags: json:"was_buffered,omitempty" msg:"was_buffered,omitempty"
454    #[prost(bool, tag = "3")]
455    #[serde(default)]
456    pub was_buffered: bool,
457    /// bufferMs specifies how long the payload was buffered in milliseconds.
458    /// @gotags: json:"buffer_ms,omitempty" msg:"buffer_ms,omitempty"
459    #[prost(int64, tag = "4")]
460    #[serde(default)]
461    pub buffer_ms: i64,
462    /// bufferEvictionReason specifies why the payload was evicted from the buffer.
463    /// @gotags: json:"buffer_eviction_reason,omitempty" msg:"buffer_eviction_reason,omitempty"
464    #[prost(string, tag = "5")]
465    #[serde(default)]
466    pub buffer_eviction_reason: ::prost::alloc::string::String,
467}
468/// AgentPayload represents payload the agent sends to the intake.
469#[derive(Clone, PartialEq, ::prost::Message)]
470pub struct AgentPayload {
471    /// hostName specifies hostname of where the agent is running.
472    #[prost(string, tag = "1")]
473    pub host_name: ::prost::alloc::string::String,
474    /// env specifies `env` set in agent configuration.
475    #[prost(string, tag = "2")]
476    pub env: ::prost::alloc::string::String,
477    /// tracerPayloads specifies list of the payloads received from tracers.
478    #[prost(message, repeated, tag = "5")]
479    pub tracer_payloads: ::prost::alloc::vec::Vec<TracerPayload>,
480    /// tags specifies tags common in all `tracerPayloads`.
481    #[prost(map = "string, string", tag = "6")]
482    pub tags: ::std::collections::HashMap<
483        ::prost::alloc::string::String,
484        ::prost::alloc::string::String,
485    >,
486    /// agentVersion specifies version of the agent.
487    #[prost(string, tag = "7")]
488    pub agent_version: ::prost::alloc::string::String,
489    /// targetTPS holds `TargetTPS` value in AgentConfig.
490    #[prost(double, tag = "8")]
491    pub target_tps: f64,
492    /// errorTPS holds `ErrorTPS` value in AgentConfig.
493    #[prost(double, tag = "9")]
494    pub error_tps: f64,
495    /// rareSamplerEnabled holds `RareSamplerEnabled` value in AgentConfig
496    #[prost(bool, tag = "10")]
497    pub rare_sampler_enabled: bool,
498    /// idxTracerPayloads specifies list of the payloads received from tracers.
499    /// @gotags: msg:"-"
500    #[prost(message, repeated, tag = "11")]
501    pub idx_tracer_payloads: ::prost::alloc::vec::Vec<idx::TracerPayload>,
502}
503/// StatsPayload is the payload used to send stats from the agent to the backend.
504#[derive(Deserialize, Serialize)]
505#[serde(rename_all = "PascalCase")]
506#[derive(Clone, PartialEq, ::prost::Message)]
507pub struct StatsPayload {
508    #[prost(string, tag = "1")]
509    pub agent_hostname: ::prost::alloc::string::String,
510    #[prost(string, tag = "2")]
511    pub agent_env: ::prost::alloc::string::String,
512    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
513    #[prost(message, repeated, tag = "3")]
514    pub stats: ::prost::alloc::vec::Vec<ClientStatsPayload>,
515    #[prost(string, tag = "4")]
516    pub agent_version: ::prost::alloc::string::String,
517    #[prost(bool, tag = "5")]
518    pub client_computed: bool,
519    /// splitPayload indicates if the payload is actually one of several payloads split out from a larger payload.
520    /// This field can be used in the backend to signal if re-aggregation is necessary.
521    #[prost(bool, tag = "6")]
522    pub split_payload: bool,
523}
524/// ClientStatsPayload is the first layer of span stats aggregation. It is also
525/// the payload sent by tracers to the agent when stats in tracer are enabled.
526#[derive(Deserialize, Serialize)]
527#[serde(rename_all = "PascalCase")]
528#[derive(Clone, PartialEq, ::prost::Message)]
529pub struct ClientStatsPayload {
530    /// Hostname is the tracer hostname. It's extracted from spans with "_dd.hostname" meta
531    /// or set by tracer stats payload when hostname reporting is enabled.
532    #[prost(string, tag = "1")]
533    #[serde(default)]
534    pub hostname: ::prost::alloc::string::String,
535    /// env tag set on spans or in the tracers, used for aggregation
536    #[prost(string, tag = "2")]
537    #[serde(default)]
538    pub env: ::prost::alloc::string::String,
539    /// version tag set on spans or in the tracers, used for aggregation
540    #[prost(string, tag = "3")]
541    #[serde(default)]
542    pub version: ::prost::alloc::string::String,
543    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
544    #[prost(message, repeated, tag = "4")]
545    #[serde(default)]
546    pub stats: ::prost::alloc::vec::Vec<ClientStatsBucket>,
547    /// informative field not used for aggregation
548    #[prost(string, tag = "5")]
549    #[serde(default)]
550    pub lang: ::prost::alloc::string::String,
551    /// informative field not used for aggregation
552    #[prost(string, tag = "6")]
553    #[serde(default)]
554    pub tracer_version: ::prost::alloc::string::String,
555    /// used on stats payloads sent by the tracer to identify uniquely a message
556    #[prost(string, tag = "7")]
557    #[serde(default)]
558    #[serde(rename = "RuntimeID")]
559    pub runtime_id: ::prost::alloc::string::String,
560    /// used on stats payloads sent by the tracer to identify uniquely a message
561    #[prost(uint64, tag = "8")]
562    #[serde(default)]
563    pub sequence: u64,
564    /// AgentAggregation is set by the agent on tracer payloads modified by the agent aggregation layer
565    /// characterizes counts only and distributions only payloads
566    #[prost(string, tag = "9")]
567    #[serde(default)]
568    pub agent_aggregation: ::prost::alloc::string::String,
569    /// Service is the main service of the tracer.
570    /// It is part of unified tagging: <https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging>
571    #[prost(string, tag = "10")]
572    #[serde(default)]
573    pub service: ::prost::alloc::string::String,
574    /// ContainerID specifies the origin container ID. It is meant to be populated by the client and may
575    /// be enhanced by the agent to ensure it is unique.
576    #[prost(string, tag = "11")]
577    #[serde(default)]
578    #[serde(rename = "ContainerID")]
579    pub container_id: ::prost::alloc::string::String,
580    /// Tags specifies a set of tags obtained from the orchestrator (where applicable) using the specified containerID.
581    /// This field should be left empty by the client. It only applies to some specific environment.
582    #[prost(string, repeated, tag = "12")]
583    #[serde(default)]
584    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
585    /// The git commit SHA is obtained from a trace, where it may be set through a tracer <-> source code integration.
586    #[prost(string, tag = "13")]
587    #[serde(default)]
588    pub git_commit_sha: ::prost::alloc::string::String,
589    /// The image tag is obtained from a container's set of tags.
590    #[prost(string, tag = "14")]
591    #[serde(default)]
592    pub image_tag: ::prost::alloc::string::String,
593    /// The process tags hash is used as a key for agent stats agregation.
594    #[prost(uint64, tag = "15")]
595    #[serde(default)]
596    pub process_tags_hash: u64,
597    /// The process tags contains a list of tags that are specific to the process.
598    #[prost(string, tag = "16")]
599    #[serde(default)]
600    pub process_tags: ::prost::alloc::string::String,
601}
602/// ClientStatsBucket is a time bucket containing aggregated stats.
603#[derive(Deserialize, Serialize)]
604#[serde(rename_all = "PascalCase")]
605#[derive(Clone, PartialEq, ::prost::Message)]
606pub struct ClientStatsBucket {
607    /// bucket start in nanoseconds
608    #[prost(uint64, tag = "1")]
609    pub start: u64,
610    /// bucket duration in nanoseconds
611    #[prost(uint64, tag = "2")]
612    pub duration: u64,
613    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
614    #[prost(message, repeated, tag = "3")]
615    pub stats: ::prost::alloc::vec::Vec<ClientGroupedStats>,
616    /// AgentTimeShift is the shift applied by the agent stats aggregator on bucket start
617    /// when the received bucket start is outside of the agent aggregation window
618    #[prost(int64, tag = "4")]
619    #[serde(default)]
620    pub agent_time_shift: i64,
621}
622/// ClientGroupedStats aggregate stats on spans grouped by service, name, resource, status_code, type
623#[derive(Deserialize, Serialize)]
624#[serde(rename_all = "PascalCase")]
625#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
626pub struct ClientGroupedStats {
627    #[prost(string, tag = "1")]
628    pub service: ::prost::alloc::string::String,
629    #[prost(string, tag = "2")]
630    pub name: ::prost::alloc::string::String,
631    #[prost(string, tag = "3")]
632    pub resource: ::prost::alloc::string::String,
633    #[prost(uint32, tag = "4")]
634    #[serde(rename = "HTTPStatusCode")]
635    pub http_status_code: u32,
636    #[prost(string, tag = "5")]
637    #[serde(default)]
638    pub r#type: ::prost::alloc::string::String,
639    /// db_type might be used in the future to help in the obfuscation step
640    #[prost(string, tag = "6")]
641    #[serde(default)]
642    #[serde(rename = "DBType")]
643    pub db_type: ::prost::alloc::string::String,
644    /// count of all spans aggregated in the groupedstats
645    #[prost(uint64, tag = "7")]
646    pub hits: u64,
647    /// count of error spans aggregated in the groupedstats
648    #[prost(uint64, tag = "8")]
649    pub errors: u64,
650    /// total duration in nanoseconds of spans aggregated in the bucket
651    #[prost(uint64, tag = "9")]
652    pub duration: u64,
653    /// ddsketch summary of ok spans latencies encoded in protobuf
654    #[prost(bytes = "vec", tag = "10")]
655    #[serde(with = "serde_bytes")]
656    pub ok_summary: ::prost::alloc::vec::Vec<u8>,
657    /// ddsketch summary of error spans latencies encoded in protobuf
658    #[prost(bytes = "vec", tag = "11")]
659    #[serde(with = "serde_bytes")]
660    pub error_summary: ::prost::alloc::vec::Vec<u8>,
661    /// set to true on spans generated by synthetics traffic
662    #[prost(bool, tag = "12")]
663    pub synthetics: bool,
664    /// count of top level spans aggregated in the groupedstats
665    #[prost(uint64, tag = "13")]
666    pub top_level_hits: u64,
667    /// value of the span.kind tag on the span
668    #[prost(string, tag = "15")]
669    #[serde(default)]
670    pub span_kind: ::prost::alloc::string::String,
671    /// peer_tags are supplementary tags that further describe a peer entity
672    /// E.g., `grpc.target` to describe the name of a gRPC peer, or `db.hostname` to describe the name of peer DB
673    #[prost(string, repeated, tag = "16")]
674    #[serde(default)]
675    pub peer_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
676    /// this field's value is equal to span's ParentID == 0.
677    #[prost(enumeration = "Trilean", tag = "17")]
678    #[serde(default)]
679    pub is_trace_root: i32,
680    #[prost(string, tag = "18")]
681    #[serde(default)]
682    #[serde(rename = "GRPCStatusCode")]
683    pub grpc_status_code: ::prost::alloc::string::String,
684    /// HTTP method of the request
685    #[prost(string, tag = "19")]
686    #[serde(default)]
687    #[serde(rename = "HTTPMethod")]
688    pub http_method: ::prost::alloc::string::String,
689    /// Http route or quantized/simplified URL path
690    #[prost(string, tag = "20")]
691    #[serde(default)]
692    #[serde(rename = "HTTPEndpoint")]
693    pub http_endpoint: ::prost::alloc::string::String,
694    /// @inject_tag: msg:"srv_src"
695    #[prost(string, tag = "21")]
696    #[serde(default)]
697    #[serde(rename = "srv_src")]
698    pub service_source: ::prost::alloc::string::String,
699    /// used to identify service override origin
700    /// Deprecated: use additional_metric_tags (field 23) instead.
701    #[prost(string, repeated, tag = "22")]
702    #[serde(default)]
703    pub span_derived_primary_tags: ::prost::alloc::vec::Vec<
704        ::prost::alloc::string::String,
705    >,
706    /// additional_metric_tags are tags sent by tracers to be used as additional dimensions for stats aggregation
707    #[prost(string, repeated, tag = "23")]
708    #[serde(default)]
709    pub additional_metric_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
710}
711/// Trilean is an expanded boolean type that is meant to differentiate between being unset and false.
712#[derive(Deserialize, Serialize)]
713#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
714#[repr(i32)]
715pub enum Trilean {
716    NotSet = 0,
717    True = 1,
718    False = 2,
719}
720impl Trilean {
721    /// String value of the enum field names used in the ProtoBuf definition.
722    ///
723    /// The values are not transformed in any way and thus are considered stable
724    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
725    pub fn as_str_name(&self) -> &'static str {
726        match self {
727            Self::NotSet => "NOT_SET",
728            Self::True => "TRUE",
729            Self::False => "FALSE",
730        }
731    }
732    /// Creates an enum from field names used in the ProtoBuf definition.
733    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
734        match value {
735            "NOT_SET" => Some(Self::NotSet),
736            "TRUE" => Some(Self::True),
737            "FALSE" => Some(Self::False),
738            _ => None,
739        }
740    }
741}
742#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
743#[repr(i32)]
744pub enum TraceRootFlag {
745    DeprecatedNotSet = 0,
746    DeprecatedTrue = 1,
747    DeprecatedFalse = 2,
748}
749impl TraceRootFlag {
750    /// String value of the enum field names used in the ProtoBuf definition.
751    ///
752    /// The values are not transformed in any way and thus are considered stable
753    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
754    pub fn as_str_name(&self) -> &'static str {
755        match self {
756            Self::DeprecatedNotSet => "DEPRECATED_NOT_SET",
757            Self::DeprecatedTrue => "DEPRECATED_TRUE",
758            Self::DeprecatedFalse => "DEPRECATED_FALSE",
759        }
760    }
761    /// Creates an enum from field names used in the ProtoBuf definition.
762    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
763        match value {
764            "DEPRECATED_NOT_SET" => Some(Self::DeprecatedNotSet),
765            "DEPRECATED_TRUE" => Some(Self::DeprecatedTrue),
766            "DEPRECATED_FALSE" => Some(Self::DeprecatedFalse),
767            _ => None,
768        }
769    }
770}