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    /// @gotags: json:"meta_struct,omitempty" msg:"meta_struct,omitempty"
331    #[prost(map = "string, bytes", tag = "13")]
332    #[serde(default)]
333    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
334    #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty")]
335    pub meta_struct: ::std::collections::HashMap<
336        ::prost::alloc::string::String,
337        ::prost::alloc::vec::Vec<u8>,
338    >,
339    /// span_links represents a collection of links, where each link defines a causal relationship between two spans.
340    /// @gotags: json:"span_links,omitempty" msg:"span_links,omitempty"
341    #[prost(message, repeated, tag = "14")]
342    #[serde(default)]
343    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
344    #[serde(skip_serializing_if = "::prost::alloc::vec::Vec::is_empty")]
345    pub span_links: ::prost::alloc::vec::Vec<SpanLink>,
346    /// spanEvents represent an event at an instant in time related to this span, but not necessarily during the span.
347    /// @gotags: json:"span_events,omitempty" msg:"span_events,omitempty"
348    #[prost(message, repeated, tag = "15")]
349    #[serde(default)]
350    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
351    #[serde(skip_serializing_if = "::prost::alloc::vec::Vec::is_empty")]
352    pub span_events: ::prost::alloc::vec::Vec<SpanEvent>,
353}
354/// TraceChunk represents a list of spans with the same trace ID. In other words, a chunk of a trace.
355#[derive(Deserialize, Serialize)]
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct TraceChunk {
358    /// priority specifies sampling priority of the trace.
359    /// @gotags: json:"priority" msg:"priority"
360    #[prost(int32, tag = "1")]
361    pub priority: i32,
362    /// origin specifies origin product ("lambda", "rum", etc.) of the trace.
363    /// @gotags: json:"origin" msg:"origin"
364    #[prost(string, tag = "2")]
365    pub origin: ::prost::alloc::string::String,
366    /// spans specifies list of containing spans.
367    /// @gotags: json:"spans" msg:"spans"
368    #[prost(message, repeated, tag = "3")]
369    pub spans: ::prost::alloc::vec::Vec<Span>,
370    /// tags specifies tags common in all `spans`.
371    /// @gotags: json:"tags" msg:"tags"
372    #[prost(map = "string, string", tag = "4")]
373    pub tags: ::std::collections::HashMap<
374        ::prost::alloc::string::String,
375        ::prost::alloc::string::String,
376    >,
377    /// droppedTrace specifies whether the trace was dropped by samplers or not.
378    /// @gotags: json:"dropped_trace" msg:"dropped_trace"
379    #[prost(bool, tag = "5")]
380    pub dropped_trace: bool,
381}
382/// TracerPayload represents a payload the trace agent receives from tracers.
383#[derive(Deserialize, Serialize)]
384#[derive(Clone, PartialEq, ::prost::Message)]
385pub struct TracerPayload {
386    /// containerID specifies the ID of the container where the tracer is running on.
387    /// @gotags: json:"container_id" msg:"container_id"
388    #[prost(string, tag = "1")]
389    pub container_id: ::prost::alloc::string::String,
390    /// languageName specifies language of the tracer.
391    /// @gotags: json:"language_name" msg:"language_name"
392    #[prost(string, tag = "2")]
393    pub language_name: ::prost::alloc::string::String,
394    /// languageVersion specifies language version of the tracer.
395    /// @gotags: json:"language_version" msg:"language_version"
396    #[prost(string, tag = "3")]
397    pub language_version: ::prost::alloc::string::String,
398    /// tracerVersion specifies version of the tracer.
399    /// @gotags: json:"tracer_version" msg:"tracer_version"
400    #[prost(string, tag = "4")]
401    pub tracer_version: ::prost::alloc::string::String,
402    /// runtimeID specifies V4 UUID representation of a tracer session.
403    /// @gotags: json:"runtime_id" msg:"runtime_id"
404    #[prost(string, tag = "5")]
405    pub runtime_id: ::prost::alloc::string::String,
406    /// chunks specifies list of containing trace chunks.
407    /// @gotags: json:"chunks" msg:"chunks"
408    #[prost(message, repeated, tag = "6")]
409    pub chunks: ::prost::alloc::vec::Vec<TraceChunk>,
410    /// tags specifies tags common in all `chunks`.
411    /// @gotags: json:"tags" msg:"tags"
412    #[prost(map = "string, string", tag = "7")]
413    pub tags: ::std::collections::HashMap<
414        ::prost::alloc::string::String,
415        ::prost::alloc::string::String,
416    >,
417    /// env specifies `env` tag that set with the tracer.
418    /// @gotags: json:"env" msg:"env"
419    #[prost(string, tag = "8")]
420    pub env: ::prost::alloc::string::String,
421    /// hostname specifies hostname of where the tracer is running.
422    /// @gotags: json:"hostname" msg:"hostname"
423    #[prost(string, tag = "9")]
424    pub hostname: ::prost::alloc::string::String,
425    /// version specifies `version` tag that set with the tracer.
426    /// @gotags: json:"app_version" msg:"app_version"
427    #[prost(string, tag = "10")]
428    pub app_version: ::prost::alloc::string::String,
429}
430/// AgentPayload represents payload the agent sends to the intake.
431#[derive(Clone, PartialEq, ::prost::Message)]
432pub struct AgentPayload {
433    /// hostName specifies hostname of where the agent is running.
434    #[prost(string, tag = "1")]
435    pub host_name: ::prost::alloc::string::String,
436    /// env specifies `env` set in agent configuration.
437    #[prost(string, tag = "2")]
438    pub env: ::prost::alloc::string::String,
439    /// tracerPayloads specifies list of the payloads received from tracers.
440    #[prost(message, repeated, tag = "5")]
441    pub tracer_payloads: ::prost::alloc::vec::Vec<TracerPayload>,
442    /// tags specifies tags common in all `tracerPayloads`.
443    #[prost(map = "string, string", tag = "6")]
444    pub tags: ::std::collections::HashMap<
445        ::prost::alloc::string::String,
446        ::prost::alloc::string::String,
447    >,
448    /// agentVersion specifies version of the agent.
449    #[prost(string, tag = "7")]
450    pub agent_version: ::prost::alloc::string::String,
451    /// targetTPS holds `TargetTPS` value in AgentConfig.
452    #[prost(double, tag = "8")]
453    pub target_tps: f64,
454    /// errorTPS holds `ErrorTPS` value in AgentConfig.
455    #[prost(double, tag = "9")]
456    pub error_tps: f64,
457    /// rareSamplerEnabled holds `RareSamplerEnabled` value in AgentConfig
458    #[prost(bool, tag = "10")]
459    pub rare_sampler_enabled: bool,
460    /// idxTracerPayloads specifies list of the payloads received from tracers.
461    /// @gotags: msg:"-"
462    #[prost(message, repeated, tag = "11")]
463    pub idx_tracer_payloads: ::prost::alloc::vec::Vec<idx::TracerPayload>,
464}
465/// StatsPayload is the payload used to send stats from the agent to the backend.
466#[derive(Deserialize, Serialize)]
467#[serde(rename_all = "PascalCase")]
468#[derive(Clone, PartialEq, ::prost::Message)]
469pub struct StatsPayload {
470    #[prost(string, tag = "1")]
471    pub agent_hostname: ::prost::alloc::string::String,
472    #[prost(string, tag = "2")]
473    pub agent_env: ::prost::alloc::string::String,
474    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
475    #[prost(message, repeated, tag = "3")]
476    pub stats: ::prost::alloc::vec::Vec<ClientStatsPayload>,
477    #[prost(string, tag = "4")]
478    pub agent_version: ::prost::alloc::string::String,
479    #[prost(bool, tag = "5")]
480    pub client_computed: bool,
481    /// splitPayload indicates if the payload is actually one of several payloads split out from a larger payload.
482    /// This field can be used in the backend to signal if re-aggregation is necessary.
483    #[prost(bool, tag = "6")]
484    pub split_payload: bool,
485}
486/// ClientStatsPayload is the first layer of span stats aggregation. It is also
487/// the payload sent by tracers to the agent when stats in tracer are enabled.
488#[derive(Deserialize, Serialize)]
489#[serde(rename_all = "PascalCase")]
490#[derive(Clone, PartialEq, ::prost::Message)]
491pub struct ClientStatsPayload {
492    /// Hostname is the tracer hostname. It's extracted from spans with "_dd.hostname" meta
493    /// or set by tracer stats payload when hostname reporting is enabled.
494    #[prost(string, tag = "1")]
495    #[serde(default)]
496    pub hostname: ::prost::alloc::string::String,
497    /// env tag set on spans or in the tracers, used for aggregation
498    #[prost(string, tag = "2")]
499    #[serde(default)]
500    pub env: ::prost::alloc::string::String,
501    /// version tag set on spans or in the tracers, used for aggregation
502    #[prost(string, tag = "3")]
503    #[serde(default)]
504    pub version: ::prost::alloc::string::String,
505    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
506    #[prost(message, repeated, tag = "4")]
507    #[serde(default)]
508    pub stats: ::prost::alloc::vec::Vec<ClientStatsBucket>,
509    /// informative field not used for aggregation
510    #[prost(string, tag = "5")]
511    #[serde(default)]
512    pub lang: ::prost::alloc::string::String,
513    /// informative field not used for aggregation
514    #[prost(string, tag = "6")]
515    #[serde(default)]
516    pub tracer_version: ::prost::alloc::string::String,
517    /// used on stats payloads sent by the tracer to identify uniquely a message
518    #[prost(string, tag = "7")]
519    #[serde(default)]
520    #[serde(rename = "RuntimeID")]
521    pub runtime_id: ::prost::alloc::string::String,
522    /// used on stats payloads sent by the tracer to identify uniquely a message
523    #[prost(uint64, tag = "8")]
524    #[serde(default)]
525    pub sequence: u64,
526    /// AgentAggregation is set by the agent on tracer payloads modified by the agent aggregation layer
527    /// characterizes counts only and distributions only payloads
528    #[prost(string, tag = "9")]
529    #[serde(default)]
530    pub agent_aggregation: ::prost::alloc::string::String,
531    /// Service is the main service of the tracer.
532    /// It is part of unified tagging: <https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging>
533    #[prost(string, tag = "10")]
534    #[serde(default)]
535    pub service: ::prost::alloc::string::String,
536    /// ContainerID specifies the origin container ID. It is meant to be populated by the client and may
537    /// be enhanced by the agent to ensure it is unique.
538    #[prost(string, tag = "11")]
539    #[serde(default)]
540    #[serde(rename = "ContainerID")]
541    pub container_id: ::prost::alloc::string::String,
542    /// Tags specifies a set of tags obtained from the orchestrator (where applicable) using the specified containerID.
543    /// This field should be left empty by the client. It only applies to some specific environment.
544    #[prost(string, repeated, tag = "12")]
545    #[serde(default)]
546    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
547    /// The git commit SHA is obtained from a trace, where it may be set through a tracer <-> source code integration.
548    #[prost(string, tag = "13")]
549    #[serde(default)]
550    pub git_commit_sha: ::prost::alloc::string::String,
551    /// The image tag is obtained from a container's set of tags.
552    #[prost(string, tag = "14")]
553    #[serde(default)]
554    pub image_tag: ::prost::alloc::string::String,
555    /// The process tags hash is used as a key for agent stats agregation.
556    #[prost(uint64, tag = "15")]
557    #[serde(default)]
558    pub process_tags_hash: u64,
559    /// The process tags contains a list of tags that are specific to the process.
560    #[prost(string, tag = "16")]
561    #[serde(default)]
562    pub process_tags: ::prost::alloc::string::String,
563}
564/// ClientStatsBucket is a time bucket containing aggregated stats.
565#[derive(Deserialize, Serialize)]
566#[serde(rename_all = "PascalCase")]
567#[derive(Clone, PartialEq, ::prost::Message)]
568pub struct ClientStatsBucket {
569    /// bucket start in nanoseconds
570    #[prost(uint64, tag = "1")]
571    pub start: u64,
572    /// bucket duration in nanoseconds
573    #[prost(uint64, tag = "2")]
574    pub duration: u64,
575    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
576    #[prost(message, repeated, tag = "3")]
577    pub stats: ::prost::alloc::vec::Vec<ClientGroupedStats>,
578    /// AgentTimeShift is the shift applied by the agent stats aggregator on bucket start
579    /// when the received bucket start is outside of the agent aggregation window
580    #[prost(int64, tag = "4")]
581    #[serde(default)]
582    pub agent_time_shift: i64,
583}
584/// ClientGroupedStats aggregate stats on spans grouped by service, name, resource, status_code, type
585#[derive(Deserialize, Serialize)]
586#[serde(rename_all = "PascalCase")]
587#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
588pub struct ClientGroupedStats {
589    #[prost(string, tag = "1")]
590    pub service: ::prost::alloc::string::String,
591    #[prost(string, tag = "2")]
592    pub name: ::prost::alloc::string::String,
593    #[prost(string, tag = "3")]
594    pub resource: ::prost::alloc::string::String,
595    #[prost(uint32, tag = "4")]
596    #[serde(rename = "HTTPStatusCode")]
597    pub http_status_code: u32,
598    #[prost(string, tag = "5")]
599    #[serde(default)]
600    pub r#type: ::prost::alloc::string::String,
601    /// db_type might be used in the future to help in the obfuscation step
602    #[prost(string, tag = "6")]
603    #[serde(default)]
604    #[serde(rename = "DBType")]
605    pub db_type: ::prost::alloc::string::String,
606    /// count of all spans aggregated in the groupedstats
607    #[prost(uint64, tag = "7")]
608    pub hits: u64,
609    /// count of error spans aggregated in the groupedstats
610    #[prost(uint64, tag = "8")]
611    pub errors: u64,
612    /// total duration in nanoseconds of spans aggregated in the bucket
613    #[prost(uint64, tag = "9")]
614    pub duration: u64,
615    /// ddsketch summary of ok spans latencies encoded in protobuf
616    #[prost(bytes = "vec", tag = "10")]
617    #[serde(with = "serde_bytes")]
618    pub ok_summary: ::prost::alloc::vec::Vec<u8>,
619    /// ddsketch summary of error spans latencies encoded in protobuf
620    #[prost(bytes = "vec", tag = "11")]
621    #[serde(with = "serde_bytes")]
622    pub error_summary: ::prost::alloc::vec::Vec<u8>,
623    /// set to true on spans generated by synthetics traffic
624    #[prost(bool, tag = "12")]
625    pub synthetics: bool,
626    /// count of top level spans aggregated in the groupedstats
627    #[prost(uint64, tag = "13")]
628    pub top_level_hits: u64,
629    /// value of the span.kind tag on the span
630    #[prost(string, tag = "15")]
631    #[serde(default)]
632    pub span_kind: ::prost::alloc::string::String,
633    /// peer_tags are supplementary tags that further describe a peer entity
634    /// E.g., `grpc.target` to describe the name of a gRPC peer, or `db.hostname` to describe the name of peer DB
635    #[prost(string, repeated, tag = "16")]
636    #[serde(default)]
637    pub peer_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
638    /// this field's value is equal to span's ParentID == 0.
639    #[prost(enumeration = "Trilean", tag = "17")]
640    #[serde(default)]
641    pub is_trace_root: i32,
642    #[prost(string, tag = "18")]
643    #[serde(default)]
644    #[serde(rename = "GRPCStatusCode")]
645    pub grpc_status_code: ::prost::alloc::string::String,
646    /// HTTP method of the request
647    #[prost(string, tag = "19")]
648    #[serde(default)]
649    #[serde(rename = "HTTPMethod")]
650    pub http_method: ::prost::alloc::string::String,
651    /// Http route or quantized/simplified URL path
652    #[prost(string, tag = "20")]
653    #[serde(default)]
654    #[serde(rename = "HTTPEndpoint")]
655    pub http_endpoint: ::prost::alloc::string::String,
656    /// @inject_tag: msg:"srv_src"
657    #[prost(string, tag = "21")]
658    #[serde(default)]
659    #[serde(rename = "srv_src")]
660    pub service_source: ::prost::alloc::string::String,
661    /// used to identify service override origin
662    /// span_derived_primary_tags are user-configured tags that are extracted from spans and used for stats aggregation
663    /// E.g., `aws.s3.bucket`, `http.url`, or any custom tag
664    #[prost(string, repeated, tag = "22")]
665    #[serde(default)]
666    pub span_derived_primary_tags: ::prost::alloc::vec::Vec<
667        ::prost::alloc::string::String,
668    >,
669}
670/// Trilean is an expanded boolean type that is meant to differentiate between being unset and false.
671#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
672#[repr(i32)]
673pub enum Trilean {
674    NotSet = 0,
675    True = 1,
676    False = 2,
677}
678impl Trilean {
679    /// String value of the enum field names used in the ProtoBuf definition.
680    ///
681    /// The values are not transformed in any way and thus are considered stable
682    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
683    pub fn as_str_name(&self) -> &'static str {
684        match self {
685            Self::NotSet => "NOT_SET",
686            Self::True => "TRUE",
687            Self::False => "FALSE",
688        }
689    }
690    /// Creates an enum from field names used in the ProtoBuf definition.
691    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
692        match value {
693            "NOT_SET" => Some(Self::NotSet),
694            "TRUE" => Some(Self::True),
695            "FALSE" => Some(Self::False),
696            _ => None,
697        }
698    }
699}
700#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
701#[repr(i32)]
702pub enum TraceRootFlag {
703    DeprecatedNotSet = 0,
704    DeprecatedTrue = 1,
705    DeprecatedFalse = 2,
706}
707impl TraceRootFlag {
708    /// String value of the enum field names used in the ProtoBuf definition.
709    ///
710    /// The values are not transformed in any way and thus are considered stable
711    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
712    pub fn as_str_name(&self) -> &'static str {
713        match self {
714            Self::DeprecatedNotSet => "DEPRECATED_NOT_SET",
715            Self::DeprecatedTrue => "DEPRECATED_TRUE",
716            Self::DeprecatedFalse => "DEPRECATED_FALSE",
717        }
718    }
719    /// Creates an enum from field names used in the ProtoBuf definition.
720    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
721        match value {
722            "DEPRECATED_NOT_SET" => Some(Self::DeprecatedNotSet),
723            "DEPRECATED_TRUE" => Some(Self::DeprecatedTrue),
724            "DEPRECATED_FALSE" => Some(Self::DeprecatedFalse),
725            _ => None,
726        }
727    }
728}