Skip to main content

libdd_trace_protobuf/
pb.idx.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/// AnyValue is a union of possible value types.
7#[derive(Deserialize, Serialize)]
8#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct AnyValue {
11    #[prost(oneof = "any_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
12    pub value: ::core::option::Option<any_value::Value>,
13}
14/// Nested message and enum types in `AnyValue`.
15pub mod any_value {
16    #[derive(serde::Deserialize, serde::Serialize)]
17    #[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
18    #[derive(Clone, PartialEq, ::prost::Oneof)]
19    pub enum Value {
20        /// stringValueRef specifies the string table ref of a string value.
21        #[prost(uint32, tag = "1")]
22        StringValueRef(u32),
23        /// boolValue specifies a bool value.
24        #[prost(bool, tag = "2")]
25        BoolValue(bool),
26        /// doubleValue specifies a double value.
27        #[prost(double, tag = "3")]
28        DoubleValue(f64),
29        /// intValue specifies an int value.
30        #[prost(int64, tag = "4")]
31        IntValue(i64),
32        /// bytesValue specifies a bytes value.
33        #[prost(bytes, tag = "5")]
34        BytesValue(::prost::alloc::vec::Vec<u8>),
35        /// arrayValue specifies an array value.
36        #[prost(message, tag = "6")]
37        ArrayValue(super::ArrayValue),
38        /// keyValueList specifies a list of key-value pairs.
39        #[prost(message, tag = "7")]
40        KeyValueList(super::KeyValueList),
41    }
42}
43/// KeyValue is a key-value pair where key is a string table ref and value is an AnyValue.
44#[derive(Deserialize, Serialize)]
45#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
46#[derive(Clone, PartialEq, ::prost::Message)]
47pub struct KeyValue {
48    /// key specifies the string table ref of a key.
49    #[prost(uint32, tag = "1")]
50    pub key: u32,
51    /// value specifies a value.
52    #[prost(message, optional, tag = "2")]
53    pub value: ::core::option::Option<AnyValue>,
54}
55/// ArrayValue is a repeated list of AnyValue that is needed since `oneof` in AnyValue
56/// cannot be `repeated`
57#[derive(Deserialize, Serialize)]
58#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct ArrayValue {
61    /// values specifies a repeated list of AnyValue.
62    #[prost(message, repeated, tag = "1")]
63    pub values: ::prost::alloc::vec::Vec<AnyValue>,
64}
65/// KeyValueList is a repeated list of KeyValue messages that is needed since `oneof`
66/// in AnyValue cannot be `repeated` or `map`
67#[derive(Deserialize, Serialize)]
68#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct KeyValueList {
71    /// keyValues specifies a repeated list of KeyValue.
72    #[prost(message, repeated, tag = "1")]
73    pub key_values: ::prost::alloc::vec::Vec<KeyValue>,
74}
75#[derive(Deserialize, Serialize)]
76#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct SpanLink {
79    /// traceID specifies the ID of the trace to which this span link belongs.
80    #[prost(bytes = "vec", tag = "1")]
81    pub trace_id: ::prost::alloc::vec::Vec<u8>,
82    /// spanID specifies the ID of this span.
83    #[prost(fixed64, tag = "2")]
84    pub span_id: u64,
85    /// attributes specifies a map of attribute key string ref to any value.
86    #[prost(map = "uint32, message", tag = "3")]
87    pub attributes: ::std::collections::HashMap<u32, AnyValue>,
88    /// tracestateRef specifies the string table ref of the W3C tracestate.
89    #[prost(uint32, tag = "4")]
90    pub tracestate_ref: u32,
91    /// flags specifies the W3C trace flags. Optional. If set, the high bit (bit 31) must be set.
92    #[prost(uint32, tag = "5")]
93    pub flags: u32,
94}
95#[derive(Deserialize, Serialize)]
96#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct SpanEvent {
99    /// time is the number of nanoseconds between the Unix epoch and this event.
100    #[prost(fixed64, tag = "1")]
101    pub time: u64,
102    /// nameRef specifies the string table ref of this event's name.
103    #[prost(uint32, tag = "2")]
104    pub name_ref: u32,
105    /// attributes is a mapping from attribute key string ref to any value.
106    #[prost(map = "uint32, message", tag = "3")]
107    pub attributes: ::std::collections::HashMap<u32, AnyValue>,
108}
109#[derive(Deserialize, Serialize)]
110#[cfg_attr(feature = "fuzzing", derive(bolero::TypeGenerator))]
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct Span {
113    /// serviceRef specifies the string table ref of this span's service name.
114    #[prost(uint32, tag = "1")]
115    pub service_ref: u32,
116    /// nameRef specifies the string table ref of this span's operation name.
117    #[prost(uint32, tag = "2")]
118    pub name_ref: u32,
119    /// resourceRef specifies the string table ref of this span's resource name.
120    #[prost(uint32, tag = "3")]
121    pub resource_ref: u32,
122    /// spanID is the ID of this span.
123    #[prost(fixed64, tag = "4")]
124    pub span_id: u64,
125    /// parentID is the ID of this span's parent, or zero if this span has no parent.
126    #[prost(uint64, tag = "5")]
127    pub parent_id: u64,
128    /// start is the number of nanoseconds between the Unix epoch and the beginning of this span.
129    #[prost(fixed64, tag = "6")]
130    pub start: u64,
131    /// duration is the time length of this span in nanoseconds.
132    #[prost(uint64, tag = "7")]
133    pub duration: u64,
134    /// error specifies if there is an error associated with this span.
135    #[prost(bool, tag = "8")]
136    pub error: bool,
137    /// attributes is a mapping from attribute key string ref to any value.
138    #[prost(map = "uint32, message", tag = "9")]
139    pub attributes: ::std::collections::HashMap<u32, AnyValue>,
140    /// typeRef is the string table ref of the type of the service with which this span is associated.  Example values: web, db, lambda.
141    #[prost(uint32, tag = "10")]
142    pub type_ref: u32,
143    /// span_links represents a collection of links, where each link defines a causal relationship between two spans.
144    #[prost(message, repeated, tag = "11")]
145    pub links: ::prost::alloc::vec::Vec<SpanLink>,
146    /// spanEvents represent an event at an instant in time related to this span, but not necessarily during the span.
147    #[prost(message, repeated, tag = "12")]
148    pub events: ::prost::alloc::vec::Vec<SpanEvent>,
149    /// envRef is the string table ref of the optional string environment of this span.
150    #[prost(uint32, tag = "13")]
151    pub env_ref: u32,
152    /// versionRef is the string table ref of the optional string version of this span.
153    #[prost(uint32, tag = "14")]
154    pub version_ref: u32,
155    /// componentRef is the string table ref of the string component name of this span.
156    #[prost(uint32, tag = "15")]
157    pub component_ref: u32,
158    /// kind is the SpanKind of this span as defined in the OTEL Specification.
159    #[prost(enumeration = "SpanKind", tag = "16")]
160    pub kind: i32,
161}
162/// SpanKind is the type of span. Can be used to specify additional relationships between spans
163/// in addition to a parent/child relationship.
164#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
165#[repr(i32)]
166pub enum SpanKind {
167    /// Unspecified. Do NOT use as default.
168    /// Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED.
169    Unspecified = 0,
170    /// Indicates that the span represents an internal operation within an application,
171    /// as opposed to an operations happening at the boundaries. Default value.
172    Internal = 1,
173    /// Indicates that the span covers server-side handling of an RPC or other
174    /// remote network request.
175    Server = 2,
176    /// Indicates that the span describes a request to some remote service.
177    Client = 3,
178    /// Indicates that the span describes a producer sending a message to a broker.
179    /// Unlike CLIENT and SERVER, there is often no direct critical path latency relationship
180    /// between producer and consumer spans. A PRODUCER span ends when the message was accepted
181    /// by the broker while the logical processing of the message might span a much longer time.
182    Producer = 4,
183    /// Indicates that the span describes consumer receiving a message from a broker.
184    /// Like the PRODUCER kind, there is often no direct critical path latency relationship
185    /// between producer and consumer spans.
186    Consumer = 5,
187}
188impl SpanKind {
189    /// String value of the enum field names used in the ProtoBuf definition.
190    ///
191    /// The values are not transformed in any way and thus are considered stable
192    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
193    pub fn as_str_name(&self) -> &'static str {
194        match self {
195            Self::Unspecified => "SPAN_KIND_UNSPECIFIED",
196            Self::Internal => "SPAN_KIND_INTERNAL",
197            Self::Server => "SPAN_KIND_SERVER",
198            Self::Client => "SPAN_KIND_CLIENT",
199            Self::Producer => "SPAN_KIND_PRODUCER",
200            Self::Consumer => "SPAN_KIND_CONSUMER",
201        }
202    }
203    /// Creates an enum from field names used in the ProtoBuf definition.
204    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
205        match value {
206            "SPAN_KIND_UNSPECIFIED" => Some(Self::Unspecified),
207            "SPAN_KIND_INTERNAL" => Some(Self::Internal),
208            "SPAN_KIND_SERVER" => Some(Self::Server),
209            "SPAN_KIND_CLIENT" => Some(Self::Client),
210            "SPAN_KIND_PRODUCER" => Some(Self::Producer),
211            "SPAN_KIND_CONSUMER" => Some(Self::Consumer),
212            _ => None,
213        }
214    }
215}
216/// TraceChunk represents a list of spans with the same trace ID. In other words, a chunk of a trace.
217#[derive(Deserialize, Serialize)]
218#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct TraceChunk {
220    /// priority specifies the string table ref of the sampling priority of the trace.
221    #[prost(int32, tag = "1")]
222    pub priority: i32,
223    /// originRef specifies the string table ref of the origin product ("lambda", "rum", etc.) of the trace.
224    #[prost(uint32, tag = "2")]
225    pub origin_ref: u32,
226    /// attributes specifies the map of string table ref to AnyValue of the tags common in all `spans`.
227    #[prost(map = "uint32, message", tag = "3")]
228    pub attributes: ::std::collections::HashMap<u32, AnyValue>,
229    /// spans specifies list of containing spans.
230    #[prost(message, repeated, tag = "4")]
231    pub spans: ::prost::alloc::vec::Vec<Span>,
232    /// droppedTrace specifies whether the trace was dropped by samplers or not.
233    #[prost(bool, tag = "5")]
234    pub dropped_trace: bool,
235    /// traceID specifies the ID of the trace to which all spans in this chunk belong.
236    #[prost(bytes = "vec", tag = "6")]
237    pub trace_id: ::prost::alloc::vec::Vec<u8>,
238    /// samplingMechanism specifies the optional sampling mechanism (previously part of span tag _dd.p.dm)
239    #[prost(uint32, tag = "7")]
240    pub sampling_mechanism: u32,
241}
242/// TracerPayload represents a payload the trace agent receives from tracers.
243#[derive(Deserialize, Serialize)]
244#[derive(Clone, PartialEq, ::prost::Message)]
245pub struct TracerPayload {
246    /// strings specifies the array of strings referenced in this tracer payload, its chunks and spans.
247    #[prost(string, repeated, tag = "1")]
248    pub strings: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
249    /// containerIDRef specifies the string table ref of the ID of the container where the tracer is running on.
250    #[prost(uint32, tag = "2")]
251    pub container_id_ref: u32,
252    /// languageNameRef specifies the string table ref of the language of the tracer.
253    #[prost(uint32, tag = "3")]
254    pub language_name_ref: u32,
255    /// languageVersionRef specifies the string table ref of the language version of the tracer.
256    #[prost(uint32, tag = "4")]
257    pub language_version_ref: u32,
258    /// tracerVersionRef specifies the string table ref of the version of the tracer.
259    #[prost(uint32, tag = "5")]
260    pub tracer_version_ref: u32,
261    /// runtimeIDRef specifies the string table ref of the V4 UUID representation of a tracer session.
262    #[prost(uint32, tag = "6")]
263    pub runtime_id_ref: u32,
264    /// envRef specifies the string table ref of the `env` tag that set with the tracer.
265    #[prost(uint32, tag = "7")]
266    pub env_ref: u32,
267    /// hostnameRef specifies the string table ref of the hostname of where the tracer is running.
268    #[prost(uint32, tag = "8")]
269    pub hostname_ref: u32,
270    /// appVersionRef specifies the string table ref of the `version` tag set in the tracer.
271    #[prost(uint32, tag = "9")]
272    pub app_version_ref: u32,
273    /// a collection of key to value pairs common in all `chunks`
274    #[prost(map = "uint32, message", tag = "10")]
275    pub attributes: ::std::collections::HashMap<u32, AnyValue>,
276    /// chunks specifies list of containing trace chunks.
277    #[prost(message, repeated, tag = "11")]
278    pub chunks: ::prost::alloc::vec::Vec<TraceChunk>,
279}