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
// 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.
/// AnyValue is a union of possible value types.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnyValue {
#[prost(oneof = "any_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
pub value: ::core::option::Option<any_value::Value>,
}
/// Nested message and enum types in `AnyValue`.
pub mod any_value {
#[derive(serde::Deserialize, serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Value {
/// stringValueRef specifies the string table ref of a string value.
#[prost(uint32, tag = "1")]
StringValueRef(u32),
/// boolValue specifies a bool value.
#[prost(bool, tag = "2")]
BoolValue(bool),
/// doubleValue specifies a double value.
#[prost(double, tag = "3")]
DoubleValue(f64),
/// intValue specifies an int value.
#[prost(int64, tag = "4")]
IntValue(i64),
/// bytesValue specifies a bytes value.
#[prost(bytes, tag = "5")]
BytesValue(::prost::alloc::vec::Vec<u8>),
/// arrayValue specifies an array value.
#[prost(message, tag = "6")]
ArrayValue(super::ArrayValue),
/// keyValueList specifies a list of key-value pairs.
#[prost(message, tag = "7")]
KeyValueList(super::KeyValueList),
}
}
/// KeyValue is a key-value pair where key is a string table ref and value is an AnyValue.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyValue {
/// key specifies the string table ref of a key.
#[prost(uint32, tag = "1")]
pub key: u32,
/// value specifies a value.
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<AnyValue>,
}
/// ArrayValue is a repeated list of AnyValue that is needed since `oneof` in AnyValue
/// cannot be `repeated`
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArrayValue {
/// values specifies a repeated list of AnyValue.
#[prost(message, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<AnyValue>,
}
/// KeyValueList is a repeated list of KeyValue messages that is needed since `oneof`
/// in AnyValue cannot be `repeated` or `map`
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyValueList {
/// keyValues specifies a repeated list of KeyValue.
#[prost(message, repeated, tag = "1")]
pub key_values: ::prost::alloc::vec::Vec<KeyValue>,
}
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpanLink {
/// traceID specifies the ID of the trace to which this span link belongs.
#[prost(bytes = "vec", tag = "1")]
pub trace_id: ::prost::alloc::vec::Vec<u8>,
/// spanID specifies the ID of this span.
#[prost(fixed64, tag = "2")]
pub span_id: u64,
/// attributes specifies a map of attribute key string ref to any value.
#[prost(map = "uint32, message", tag = "3")]
pub attributes: ::std::collections::HashMap<u32, AnyValue>,
/// tracestateRef specifies the string table ref of the W3C tracestate.
#[prost(uint32, tag = "4")]
pub tracestate_ref: u32,
/// flags specifies the W3C trace flags. Optional. If set, the high bit (bit 31) must be set.
#[prost(uint32, tag = "5")]
pub flags: u32,
}
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpanEvent {
/// time is the number of nanoseconds between the Unix epoch and this event.
#[prost(fixed64, tag = "1")]
pub time: u64,
/// nameRef specifies the string table ref of this event's name.
#[prost(uint32, tag = "2")]
pub name_ref: u32,
/// attributes is a mapping from attribute key string ref to any value.
#[prost(map = "uint32, message", tag = "3")]
pub attributes: ::std::collections::HashMap<u32, AnyValue>,
}
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Span {
/// serviceRef specifies the string table ref of this span's service name.
#[prost(uint32, tag = "1")]
pub service_ref: u32,
/// nameRef specifies the string table ref of this span's operation name.
#[prost(uint32, tag = "2")]
pub name_ref: u32,
/// resourceRef specifies the string table ref of this span's resource name.
#[prost(uint32, tag = "3")]
pub resource_ref: u32,
/// spanID is the ID of this span.
#[prost(fixed64, tag = "4")]
pub span_id: u64,
/// parentID is the ID of this span's parent, or zero if this span has no parent.
#[prost(uint64, tag = "5")]
pub parent_id: u64,
/// start is the number of nanoseconds between the Unix epoch and the beginning of this span.
#[prost(fixed64, tag = "6")]
pub start: u64,
/// duration is the time length of this span in nanoseconds.
#[prost(uint64, tag = "7")]
pub duration: u64,
/// error specifies if there is an error associated with this span.
#[prost(bool, tag = "8")]
pub error: bool,
/// attributes is a mapping from attribute key string ref to any value.
#[prost(map = "uint32, message", tag = "9")]
pub attributes: ::std::collections::HashMap<u32, AnyValue>,
/// typeRef is the string table ref of the type of the service with which this span is associated. Example values: web, db, lambda.
#[prost(uint32, tag = "10")]
pub type_ref: u32,
/// span_links represents a collection of links, where each link defines a causal relationship between two spans.
#[prost(message, repeated, tag = "11")]
pub 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.
#[prost(message, repeated, tag = "12")]
pub events: ::prost::alloc::vec::Vec<SpanEvent>,
/// envRef is the string table ref of the optional string environment of this span.
#[prost(uint32, tag = "13")]
pub env_ref: u32,
/// versionRef is the string table ref of the optional string version of this span.
#[prost(uint32, tag = "14")]
pub version_ref: u32,
/// componentRef is the string table ref of the string component name of this span.
#[prost(uint32, tag = "15")]
pub component_ref: u32,
/// kind is the SpanKind of this span as defined in the OTEL Specification.
#[prost(enumeration = "SpanKind", tag = "16")]
pub kind: i32,
}
/// SpanKind is the type of span. Can be used to specify additional relationships between spans
/// in addition to a parent/child relationship.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpanKind {
/// Unspecified. Do NOT use as default.
/// Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED.
Unspecified = 0,
/// Indicates that the span represents an internal operation within an application,
/// as opposed to an operations happening at the boundaries. Default value.
Internal = 1,
/// Indicates that the span covers server-side handling of an RPC or other
/// remote network request.
Server = 2,
/// Indicates that the span describes a request to some remote service.
Client = 3,
/// Indicates that the span describes a producer sending a message to a broker.
/// Unlike CLIENT and SERVER, there is often no direct critical path latency relationship
/// between producer and consumer spans. A PRODUCER span ends when the message was accepted
/// by the broker while the logical processing of the message might span a much longer time.
Producer = 4,
/// Indicates that the span describes consumer receiving a message from a broker.
/// Like the PRODUCER kind, there is often no direct critical path latency relationship
/// between producer and consumer spans.
Consumer = 5,
}
impl SpanKind {
/// 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::Unspecified => "SPAN_KIND_UNSPECIFIED",
Self::Internal => "SPAN_KIND_INTERNAL",
Self::Server => "SPAN_KIND_SERVER",
Self::Client => "SPAN_KIND_CLIENT",
Self::Producer => "SPAN_KIND_PRODUCER",
Self::Consumer => "SPAN_KIND_CONSUMER",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SPAN_KIND_UNSPECIFIED" => Some(Self::Unspecified),
"SPAN_KIND_INTERNAL" => Some(Self::Internal),
"SPAN_KIND_SERVER" => Some(Self::Server),
"SPAN_KIND_CLIENT" => Some(Self::Client),
"SPAN_KIND_PRODUCER" => Some(Self::Producer),
"SPAN_KIND_CONSUMER" => Some(Self::Consumer),
_ => None,
}
}
}
/// 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 the string table ref of the sampling priority of the trace.
#[prost(int32, tag = "1")]
pub priority: i32,
/// originRef specifies the string table ref of the origin product ("lambda", "rum", etc.) of the trace.
#[prost(uint32, tag = "2")]
pub origin_ref: u32,
/// attributes specifies the map of string table ref to AnyValue of the tags common in all `spans`.
#[prost(map = "uint32, message", tag = "3")]
pub attributes: ::std::collections::HashMap<u32, AnyValue>,
/// spans specifies list of containing spans.
#[prost(message, repeated, tag = "4")]
pub spans: ::prost::alloc::vec::Vec<Span>,
/// droppedTrace specifies whether the trace was dropped by samplers or not.
#[prost(bool, tag = "5")]
pub dropped_trace: bool,
/// traceID specifies the ID of the trace to which all spans in this chunk belong.
#[prost(bytes = "vec", tag = "6")]
pub trace_id: ::prost::alloc::vec::Vec<u8>,
/// samplingMechanism specifies the optional sampling mechanism (previously part of span tag _dd.p.dm)
#[prost(uint32, tag = "7")]
pub sampling_mechanism: u32,
}
/// TracerPayload represents a payload the trace agent receives from tracers.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TracerPayload {
/// strings specifies the array of strings referenced in this tracer payload, its chunks and spans.
#[prost(string, repeated, tag = "1")]
pub strings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// containerIDRef specifies the string table ref of the ID of the container where the tracer is running on.
#[prost(uint32, tag = "2")]
pub container_id_ref: u32,
/// languageNameRef specifies the string table ref of the language of the tracer.
#[prost(uint32, tag = "3")]
pub language_name_ref: u32,
/// languageVersionRef specifies the string table ref of the language version of the tracer.
#[prost(uint32, tag = "4")]
pub language_version_ref: u32,
/// tracerVersionRef specifies the string table ref of the version of the tracer.
#[prost(uint32, tag = "5")]
pub tracer_version_ref: u32,
/// runtimeIDRef specifies the string table ref of the V4 UUID representation of a tracer session.
#[prost(uint32, tag = "6")]
pub runtime_id_ref: u32,
/// envRef specifies the string table ref of the `env` tag that set with the tracer.
#[prost(uint32, tag = "7")]
pub env_ref: u32,
/// hostnameRef specifies the string table ref of the hostname of where the tracer is running.
#[prost(uint32, tag = "8")]
pub hostname_ref: u32,
/// appVersionRef specifies the string table ref of the `version` tag set in the tracer.
#[prost(uint32, tag = "9")]
pub app_version_ref: u32,
/// a collection of key to value pairs common in all `chunks`
#[prost(map = "uint32, message", tag = "10")]
pub attributes: ::std::collections::HashMap<u32, AnyValue>,
/// chunks specifies list of containing trace chunks.
#[prost(message, repeated, tag = "11")]
pub chunks: ::prost::alloc::vec::Vec<TraceChunk>,
}