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