libdd-trace-protobuf 2.0.0

Protobuf utils for Datadog's traces serialization
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
// Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

use serde::{Deserialize, Serialize};
// This file is @generated by prost-build.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpanLink {
    /// @gotags: json:"trace_id" msg:"trace_id"
    ///
    /// Required.
    #[prost(uint64, tag = "1")]
    pub trace_id: u64,
    /// @gotags: json:"trace_id_high" msg:"trace_id_high,omitempty"
    ///
    /// Optional. The high 64 bits of a referenced trace id.
    #[prost(uint64, tag = "2")]
    #[serde(default)]
    pub trace_id_high: u64,
    /// @gotags: json:"span_id" msg:"span_id"
    ///
    /// Required.
    #[prost(uint64, tag = "3")]
    pub span_id: u64,
    /// @gotags: msg:"attributes,omitempty"
    ///
    /// Optional. Simple mapping of keys to string values.
    #[prost(map = "string, string", tag = "4")]
    #[serde(default)]
    pub attributes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// @gotags: msg:"tracestate,omitempty"
    ///
    /// Optional. W3C tracestate.
    #[prost(string, tag = "5")]
    #[serde(default)]
    pub tracestate: ::prost::alloc::string::String,
    /// @gotags: msg:"flags,omitempty"
    ///
    /// Optional. W3C trace flags. If set, the high bit (bit 31) must be set.
    #[prost(uint32, tag = "6")]
    #[serde(default)]
    pub flags: u32,
}
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpanEvent {
    /// @gotags: json:"time_unix_nano" msg:"time_unix_nano"
    ///
    /// time is the number of nanoseconds between the Unix epoch and this event.
    #[prost(fixed64, tag = "1")]
    #[serde(default)]
    pub time_unix_nano: u64,
    /// @gotags: json:"name" msg:"name"
    ///
    /// name is this event's name.
    #[prost(string, tag = "2")]
    #[serde(default)]
    pub name: ::prost::alloc::string::String,
    /// attributes is a mapping from attribute key string to any value.
    /// The order of attributes should be preserved in the key/value map.
    /// The supported values match the OpenTelemetry attributes specification:
    /// <https://github.com/open-telemetry/opentelemetry-proto/blob/a8f08fc49d60538f97ffabcc7feac92f832976dd/opentelemetry/proto/common/v1/common.proto>
    /// @gotags: json:"attributes" msg:"attributes"
    #[prost(map = "string, message", tag = "3")]
    #[serde(default)]
    pub attributes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        AttributeAnyValue,
    >,
}
/// AttributeAnyValue is used to represent any type of attribute value. AttributeAnyValue may contain a
/// primitive value such as a string or integer or it may contain an arbitrary nested
/// object containing arrays, key-value lists and primitives.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttributeAnyValue {
    /// We implement a union manually here because Go's MessagePack generator does not support
    /// Protobuf `oneof` unions: <https://github.com/tinylib/msgp/issues/184>
    /// Despite this, the format represented here is binary compatible with `oneof`, if we choose
    /// to migrate to that in the future.
    /// @gotags: json:"type" msg:"type"
    #[prost(enumeration = "attribute_any_value::AttributeAnyValueType", tag = "1")]
    #[serde(default)]
    pub r#type: i32,
    /// @gotags: json:"string_value" msg:"string_value"
    #[prost(string, tag = "2")]
    #[serde(default)]
    pub string_value: ::prost::alloc::string::String,
    /// @gotags: json:"bool_value" msg:"bool_value"
    #[prost(bool, tag = "3")]
    #[serde(default)]
    pub bool_value: bool,
    /// @gotags: json:"int_value" msg:"int_value"
    #[prost(int64, tag = "4")]
    #[serde(default)]
    pub int_value: i64,
    /// @gotags: json:"double_value" msg:"double_value"
    #[prost(double, tag = "5")]
    #[serde(default)]
    pub double_value: f64,
    /// @gotags: json:"array_value" msg:"array_value"
    #[prost(message, optional, tag = "6")]
    #[serde(default)]
    pub array_value: ::core::option::Option<AttributeArray>,
}
/// Nested message and enum types in `AttributeAnyValue`.
pub mod attribute_any_value {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum AttributeAnyValueType {
        StringValue = 0,
        BoolValue = 1,
        IntValue = 2,
        DoubleValue = 3,
        ArrayValue = 4,
    }
    impl AttributeAnyValueType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::StringValue => "STRING_VALUE",
                Self::BoolValue => "BOOL_VALUE",
                Self::IntValue => "INT_VALUE",
                Self::DoubleValue => "DOUBLE_VALUE",
                Self::ArrayValue => "ARRAY_VALUE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STRING_VALUE" => Some(Self::StringValue),
                "BOOL_VALUE" => Some(Self::BoolValue),
                "INT_VALUE" => Some(Self::IntValue),
                "DOUBLE_VALUE" => Some(Self::DoubleValue),
                "ARRAY_VALUE" => Some(Self::ArrayValue),
                _ => None,
            }
        }
    }
}
/// AttributeArray is a list of AttributeArrayValue messages. We need this as a message since `oneof` in AttributeAnyValue does not allow repeated fields.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttributeArray {
    /// Array of values. The array may be empty (contain 0 elements).
    /// @gotags: json:"values" msg:"values"
    #[prost(message, repeated, tag = "1")]
    #[serde(default)]
    pub values: ::prost::alloc::vec::Vec<AttributeArrayValue>,
}
/// An element in the homogeneous AttributeArray.
/// Compared to AttributeAnyValue, it only supports scalar values.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AttributeArrayValue {
    /// We implement a union manually here because Go's MessagePack generator does not support
    /// Protobuf `oneof` unions: <https://github.com/tinylib/msgp/issues/184>
    /// Despite this, the format represented here is binary compatible with `oneof`, if we choose
    /// to migrate to that in the future.
    /// @gotags: json:"type" msg:"type"
    #[prost(enumeration = "attribute_array_value::AttributeArrayValueType", tag = "1")]
    #[serde(default)]
    pub r#type: i32,
    /// @gotags: json:"string_value" msg:"string_value"
    #[prost(string, tag = "2")]
    #[serde(default)]
    pub string_value: ::prost::alloc::string::String,
    /// @gotags: json:"bool_value" msg:"bool_value"
    #[prost(bool, tag = "3")]
    #[serde(default)]
    pub bool_value: bool,
    /// @gotags: json:"int_value" msg:"int_value"
    #[prost(int64, tag = "4")]
    #[serde(default)]
    pub int_value: i64,
    /// @gotags: json:"double_value" msg:"double_value"
    #[prost(double, tag = "5")]
    #[serde(default)]
    pub double_value: f64,
}
/// Nested message and enum types in `AttributeArrayValue`.
pub mod attribute_array_value {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum AttributeArrayValueType {
        StringValue = 0,
        BoolValue = 1,
        IntValue = 2,
        DoubleValue = 3,
    }
    impl AttributeArrayValueType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::StringValue => "STRING_VALUE",
                Self::BoolValue => "BOOL_VALUE",
                Self::IntValue => "INT_VALUE",
                Self::DoubleValue => "DOUBLE_VALUE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STRING_VALUE" => Some(Self::StringValue),
                "BOOL_VALUE" => Some(Self::BoolValue),
                "INT_VALUE" => Some(Self::IntValue),
                "DOUBLE_VALUE" => Some(Self::DoubleValue),
                _ => None,
            }
        }
    }
}
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Span {
    /// service is the name of the service with which this span is associated.
    /// @gotags: json:"service" msg:"service"
    #[prost(string, tag = "1")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub service: ::prost::alloc::string::String,
    /// name is the operation name of this span.
    /// @gotags: json:"name" msg:"name"
    #[prost(string, tag = "2")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub name: ::prost::alloc::string::String,
    /// resource is the resource name of this span, also sometimes called the endpoint (for web spans).
    /// @gotags: json:"resource" msg:"resource"
    #[prost(string, tag = "3")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub resource: ::prost::alloc::string::String,
    /// traceID is the ID of the trace to which this span belongs.
    /// @gotags: json:"trace_id" msg:"trace_id"
    #[prost(uint64, tag = "4")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub trace_id: u64,
    /// spanID is the ID of this span.
    /// @gotags: json:"span_id" msg:"span_id"
    #[prost(uint64, tag = "5")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub span_id: u64,
    /// parentID is the ID of this span's parent, or zero if this span has no parent.
    /// @gotags: json:"parent_id" msg:"parent_id"
    #[prost(uint64, tag = "6")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub parent_id: u64,
    /// start is the number of nanoseconds between the Unix epoch and the beginning of this span.
    /// @gotags: json:"start" msg:"start"
    #[prost(int64, tag = "7")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub start: i64,
    /// duration is the time length of this span in nanoseconds.
    /// @gotags: json:"duration" msg:"duration"
    #[prost(int64, tag = "8")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_duration")]
    pub duration: i64,
    /// error is 1 if there is an error associated with this span, or 0 if there is not.
    /// @gotags: json:"error" msg:"error"
    #[prost(int32, tag = "9")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    #[serde(skip_serializing_if = "crate::deserializers::is_default")]
    pub error: i32,
    /// meta is a mapping from tag name to tag value for string-valued tags.
    /// @gotags: json:"meta,omitempty" msg:"meta,omitempty"
    #[prost(map = "string, string", tag = "10")]
    #[serde(default)]
    #[serde(
        deserialize_with = "crate::deserializers::deserialize_map_with_nullable_values"
    )]
    pub meta: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// metrics is a mapping from tag name to tag value for numeric-valued tags.
    /// @gotags: json:"metrics,omitempty" msg:"metrics,omitempty"
    #[prost(map = "string, double", tag = "11")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub metrics: ::std::collections::HashMap<::prost::alloc::string::String, f64>,
    /// type is the type of the service with which this span is associated.  Example values: web, db, lambda.
    /// @gotags: json:"type" msg:"type"
    #[prost(string, tag = "12")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    pub r#type: ::prost::alloc::string::String,
    /// meta_struct is a registry of structured "other" data used by, e.g., AppSec.
    /// @gotags: json:"meta_struct,omitempty" msg:"meta_struct,omitempty"
    #[prost(map = "string, bytes", tag = "13")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    #[serde(skip_serializing_if = "::std::collections::HashMap::is_empty")]
    pub meta_struct: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::vec::Vec<u8>,
    >,
    /// span_links represents a collection of links, where each link defines a causal relationship between two spans.
    /// @gotags: json:"span_links,omitempty" msg:"span_links,omitempty"
    #[prost(message, repeated, tag = "14")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    #[serde(skip_serializing_if = "::prost::alloc::vec::Vec::is_empty")]
    pub span_links: ::prost::alloc::vec::Vec<SpanLink>,
    /// spanEvents represent an event at an instant in time related to this span, but not necessarily during the span.
    /// @gotags: json:"span_events,omitempty" msg:"span_events,omitempty"
    #[prost(message, repeated, tag = "15")]
    #[serde(default)]
    #[serde(deserialize_with = "crate::deserializers::deserialize_null_into_default")]
    #[serde(skip_serializing_if = "::prost::alloc::vec::Vec::is_empty")]
    pub span_events: ::prost::alloc::vec::Vec<SpanEvent>,
}
/// TraceChunk represents a list of spans with the same trace ID. In other words, a chunk of a trace.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TraceChunk {
    /// priority specifies sampling priority of the trace.
    /// @gotags: json:"priority" msg:"priority"
    #[prost(int32, tag = "1")]
    pub priority: i32,
    /// origin specifies origin product ("lambda", "rum", etc.) of the trace.
    /// @gotags: json:"origin" msg:"origin"
    #[prost(string, tag = "2")]
    pub origin: ::prost::alloc::string::String,
    /// spans specifies list of containing spans.
    /// @gotags: json:"spans" msg:"spans"
    #[prost(message, repeated, tag = "3")]
    pub spans: ::prost::alloc::vec::Vec<Span>,
    /// tags specifies tags common in all `spans`.
    /// @gotags: json:"tags" msg:"tags"
    #[prost(map = "string, string", tag = "4")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// droppedTrace specifies whether the trace was dropped by samplers or not.
    /// @gotags: json:"dropped_trace" msg:"dropped_trace"
    #[prost(bool, tag = "5")]
    pub dropped_trace: bool,
}
/// TracerPayload represents a payload the trace agent receives from tracers.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TracerPayload {
    /// containerID specifies the ID of the container where the tracer is running on.
    /// @gotags: json:"container_id" msg:"container_id"
    #[prost(string, tag = "1")]
    pub container_id: ::prost::alloc::string::String,
    /// languageName specifies language of the tracer.
    /// @gotags: json:"language_name" msg:"language_name"
    #[prost(string, tag = "2")]
    pub language_name: ::prost::alloc::string::String,
    /// languageVersion specifies language version of the tracer.
    /// @gotags: json:"language_version" msg:"language_version"
    #[prost(string, tag = "3")]
    pub language_version: ::prost::alloc::string::String,
    /// tracerVersion specifies version of the tracer.
    /// @gotags: json:"tracer_version" msg:"tracer_version"
    #[prost(string, tag = "4")]
    pub tracer_version: ::prost::alloc::string::String,
    /// runtimeID specifies V4 UUID representation of a tracer session.
    /// @gotags: json:"runtime_id" msg:"runtime_id"
    #[prost(string, tag = "5")]
    pub runtime_id: ::prost::alloc::string::String,
    /// chunks specifies list of containing trace chunks.
    /// @gotags: json:"chunks" msg:"chunks"
    #[prost(message, repeated, tag = "6")]
    pub chunks: ::prost::alloc::vec::Vec<TraceChunk>,
    /// tags specifies tags common in all `chunks`.
    /// @gotags: json:"tags" msg:"tags"
    #[prost(map = "string, string", tag = "7")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// env specifies `env` tag that set with the tracer.
    /// @gotags: json:"env" msg:"env"
    #[prost(string, tag = "8")]
    pub env: ::prost::alloc::string::String,
    /// hostname specifies hostname of where the tracer is running.
    /// @gotags: json:"hostname" msg:"hostname"
    #[prost(string, tag = "9")]
    pub hostname: ::prost::alloc::string::String,
    /// version specifies `version` tag that set with the tracer.
    /// @gotags: json:"app_version" msg:"app_version"
    #[prost(string, tag = "10")]
    pub app_version: ::prost::alloc::string::String,
}
/// AgentPayload represents payload the agent sends to the intake.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AgentPayload {
    /// hostName specifies hostname of where the agent is running.
    #[prost(string, tag = "1")]
    pub host_name: ::prost::alloc::string::String,
    /// env specifies `env` set in agent configuration.
    #[prost(string, tag = "2")]
    pub env: ::prost::alloc::string::String,
    /// tracerPayloads specifies list of the payloads received from tracers.
    #[prost(message, repeated, tag = "5")]
    pub tracer_payloads: ::prost::alloc::vec::Vec<TracerPayload>,
    /// tags specifies tags common in all `tracerPayloads`.
    #[prost(map = "string, string", tag = "6")]
    pub tags: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// agentVersion specifies version of the agent.
    #[prost(string, tag = "7")]
    pub agent_version: ::prost::alloc::string::String,
    /// targetTPS holds `TargetTPS` value in AgentConfig.
    #[prost(double, tag = "8")]
    pub target_tps: f64,
    /// errorTPS holds `ErrorTPS` value in AgentConfig.
    #[prost(double, tag = "9")]
    pub error_tps: f64,
    /// rareSamplerEnabled holds `RareSamplerEnabled` value in AgentConfig
    #[prost(bool, tag = "10")]
    pub rare_sampler_enabled: bool,
    /// idxTracerPayloads specifies list of the payloads received from tracers.
    /// @gotags: msg:"-"
    #[prost(message, repeated, tag = "11")]
    pub idx_tracer_payloads: ::prost::alloc::vec::Vec<idx::TracerPayload>,
}
/// StatsPayload is the payload used to send stats from the agent to the backend.
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatsPayload {
    #[prost(string, tag = "1")]
    pub agent_hostname: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub agent_env: ::prost::alloc::string::String,
    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
    #[prost(message, repeated, tag = "3")]
    pub stats: ::prost::alloc::vec::Vec<ClientStatsPayload>,
    #[prost(string, tag = "4")]
    pub agent_version: ::prost::alloc::string::String,
    #[prost(bool, tag = "5")]
    pub client_computed: bool,
    /// splitPayload indicates if the payload is actually one of several payloads split out from a larger payload.
    /// This field can be used in the backend to signal if re-aggregation is necessary.
    #[prost(bool, tag = "6")]
    pub split_payload: bool,
}
/// ClientStatsPayload is the first layer of span stats aggregation. It is also
/// the payload sent by tracers to the agent when stats in tracer are enabled.
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientStatsPayload {
    /// Hostname is the tracer hostname. It's extracted from spans with "_dd.hostname" meta
    /// or set by tracer stats payload when hostname reporting is enabled.
    #[prost(string, tag = "1")]
    #[serde(default)]
    pub hostname: ::prost::alloc::string::String,
    /// env tag set on spans or in the tracers, used for aggregation
    #[prost(string, tag = "2")]
    #[serde(default)]
    pub env: ::prost::alloc::string::String,
    /// version tag set on spans or in the tracers, used for aggregation
    #[prost(string, tag = "3")]
    #[serde(default)]
    pub version: ::prost::alloc::string::String,
    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
    #[prost(message, repeated, tag = "4")]
    #[serde(default)]
    pub stats: ::prost::alloc::vec::Vec<ClientStatsBucket>,
    /// informative field not used for aggregation
    #[prost(string, tag = "5")]
    #[serde(default)]
    pub lang: ::prost::alloc::string::String,
    /// informative field not used for aggregation
    #[prost(string, tag = "6")]
    #[serde(default)]
    pub tracer_version: ::prost::alloc::string::String,
    /// used on stats payloads sent by the tracer to identify uniquely a message
    #[prost(string, tag = "7")]
    #[serde(default)]
    #[serde(rename = "RuntimeID")]
    pub runtime_id: ::prost::alloc::string::String,
    /// used on stats payloads sent by the tracer to identify uniquely a message
    #[prost(uint64, tag = "8")]
    #[serde(default)]
    pub sequence: u64,
    /// AgentAggregation is set by the agent on tracer payloads modified by the agent aggregation layer
    /// characterizes counts only and distributions only payloads
    #[prost(string, tag = "9")]
    #[serde(default)]
    pub agent_aggregation: ::prost::alloc::string::String,
    /// Service is the main service of the tracer.
    /// It is part of unified tagging: <https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging>
    #[prost(string, tag = "10")]
    #[serde(default)]
    pub service: ::prost::alloc::string::String,
    /// ContainerID specifies the origin container ID. It is meant to be populated by the client and may
    /// be enhanced by the agent to ensure it is unique.
    #[prost(string, tag = "11")]
    #[serde(default)]
    #[serde(rename = "ContainerID")]
    pub container_id: ::prost::alloc::string::String,
    /// Tags specifies a set of tags obtained from the orchestrator (where applicable) using the specified containerID.
    /// This field should be left empty by the client. It only applies to some specific environment.
    #[prost(string, repeated, tag = "12")]
    #[serde(default)]
    pub tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The git commit SHA is obtained from a trace, where it may be set through a tracer <-> source code integration.
    #[prost(string, tag = "13")]
    #[serde(default)]
    pub git_commit_sha: ::prost::alloc::string::String,
    /// The image tag is obtained from a container's set of tags.
    #[prost(string, tag = "14")]
    #[serde(default)]
    pub image_tag: ::prost::alloc::string::String,
    /// The process tags hash is used as a key for agent stats agregation.
    #[prost(uint64, tag = "15")]
    #[serde(default)]
    pub process_tags_hash: u64,
    /// The process tags contains a list of tags that are specific to the process.
    #[prost(string, tag = "16")]
    #[serde(default)]
    pub process_tags: ::prost::alloc::string::String,
}
/// ClientStatsBucket is a time bucket containing aggregated stats.
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientStatsBucket {
    /// bucket start in nanoseconds
    #[prost(uint64, tag = "1")]
    pub start: u64,
    /// bucket duration in nanoseconds
    #[prost(uint64, tag = "2")]
    pub duration: u64,
    /// @gotags: json:"stats,omitempty" msg:"Stats,omitempty"
    #[prost(message, repeated, tag = "3")]
    pub stats: ::prost::alloc::vec::Vec<ClientGroupedStats>,
    /// AgentTimeShift is the shift applied by the agent stats aggregator on bucket start
    /// when the received bucket start is outside of the agent aggregation window
    #[prost(int64, tag = "4")]
    #[serde(default)]
    pub agent_time_shift: i64,
}
/// ClientGroupedStats aggregate stats on spans grouped by service, name, resource, status_code, type
#[derive(Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ClientGroupedStats {
    #[prost(string, tag = "1")]
    pub service: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub resource: ::prost::alloc::string::String,
    #[prost(uint32, tag = "4")]
    #[serde(rename = "HTTPStatusCode")]
    pub http_status_code: u32,
    #[prost(string, tag = "5")]
    #[serde(default)]
    pub r#type: ::prost::alloc::string::String,
    /// db_type might be used in the future to help in the obfuscation step
    #[prost(string, tag = "6")]
    #[serde(default)]
    #[serde(rename = "DBType")]
    pub db_type: ::prost::alloc::string::String,
    /// count of all spans aggregated in the groupedstats
    #[prost(uint64, tag = "7")]
    pub hits: u64,
    /// count of error spans aggregated in the groupedstats
    #[prost(uint64, tag = "8")]
    pub errors: u64,
    /// total duration in nanoseconds of spans aggregated in the bucket
    #[prost(uint64, tag = "9")]
    pub duration: u64,
    /// ddsketch summary of ok spans latencies encoded in protobuf
    #[prost(bytes = "vec", tag = "10")]
    #[serde(with = "serde_bytes")]
    pub ok_summary: ::prost::alloc::vec::Vec<u8>,
    /// ddsketch summary of error spans latencies encoded in protobuf
    #[prost(bytes = "vec", tag = "11")]
    #[serde(with = "serde_bytes")]
    pub error_summary: ::prost::alloc::vec::Vec<u8>,
    /// set to true on spans generated by synthetics traffic
    #[prost(bool, tag = "12")]
    pub synthetics: bool,
    /// count of top level spans aggregated in the groupedstats
    #[prost(uint64, tag = "13")]
    pub top_level_hits: u64,
    /// value of the span.kind tag on the span
    #[prost(string, tag = "15")]
    #[serde(default)]
    pub span_kind: ::prost::alloc::string::String,
    /// peer_tags are supplementary tags that further describe a peer entity
    /// E.g., `grpc.target` to describe the name of a gRPC peer, or `db.hostname` to describe the name of peer DB
    #[prost(string, repeated, tag = "16")]
    #[serde(default)]
    pub peer_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// this field's value is equal to span's ParentID == 0.
    #[prost(enumeration = "Trilean", tag = "17")]
    #[serde(default)]
    pub is_trace_root: i32,
    #[prost(string, tag = "18")]
    #[serde(default)]
    pub grpc_status_code: ::prost::alloc::string::String,
    /// HTTP method of the request
    #[prost(string, tag = "19")]
    #[serde(default)]
    #[serde(rename = "HTTPMethod")]
    pub http_method: ::prost::alloc::string::String,
    /// Http route or quantized/simplified URL path
    #[prost(string, tag = "20")]
    #[serde(default)]
    #[serde(rename = "HTTPEndpoint")]
    pub http_endpoint: ::prost::alloc::string::String,
    /// @inject_tag: msg:"srv_src"
    #[prost(string, tag = "21")]
    #[serde(default)]
    pub service_source: ::prost::alloc::string::String,
    /// used to identify service override origin
    /// span_derived_primary_tags are user-configured tags that are extracted from spans and used for stats aggregation
    /// E.g., `aws.s3.bucket`, `http.url`, or any custom tag
    #[prost(string, repeated, tag = "22")]
    #[serde(default)]
    pub span_derived_primary_tags: ::prost::alloc::vec::Vec<
        ::prost::alloc::string::String,
    >,
}
/// Trilean is an expanded boolean type that is meant to differentiate between being unset and false.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Trilean {
    NotSet = 0,
    True = 1,
    False = 2,
}
impl Trilean {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::NotSet => "NOT_SET",
            Self::True => "TRUE",
            Self::False => "FALSE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "NOT_SET" => Some(Self::NotSet),
            "TRUE" => Some(Self::True),
            "FALSE" => Some(Self::False),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TraceRootFlag {
    DeprecatedNotSet = 0,
    DeprecatedTrue = 1,
    DeprecatedFalse = 2,
}
impl TraceRootFlag {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::DeprecatedNotSet => "DEPRECATED_NOT_SET",
            Self::DeprecatedTrue => "DEPRECATED_TRUE",
            Self::DeprecatedFalse => "DEPRECATED_FALSE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DEPRECATED_NOT_SET" => Some(Self::DeprecatedNotSet),
            "DEPRECATED_TRUE" => Some(Self::DeprecatedTrue),
            "DEPRECATED_FALSE" => Some(Self::DeprecatedFalse),
            _ => None,
        }
    }
}