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
|
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include <protozero/types.hpp>
//////////////////////////////////////////////////////////////////////////
//
// OTEL .proto definitions, for reference
//
#if 0
// clang-format off
////////////////////////////////////////////////////////////////////////
// resource/v1/resource.proto
//
// Resource information.
message Resource {
// Set of attributes that describe the resource.
// Attribute keys MUST be unique (it is not allowed to have more than one
// attribute with the same key).
//
// The attribute values SHOULD NOT contain empty values.
// The attribute values SHOULD NOT contain bytes values.
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
// double values.
// The attribute values SHOULD NOT contain kvlist values.
// The behavior of software that receives attributes containing such values can be unpredictable.
// These restrictions can change in a minor release.
// The restrictions take origin from the OpenTelemetry specification:
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
repeated opentelemetry.proto.common.v1.KeyValue attributes = 1;
// The number of dropped attributes. If the value is 0, then
// no attributes were dropped.
uint32 dropped_attributes_count = 2;
// Set of entities that participate in this Resource.
//
// Note: keys in the references MUST exist in attributes of this message.
//
// Status: [Development]
repeated opentelemetry.proto.common.v1.EntityRef entity_refs = 3;
}
/////////////////////////////////////////////////////////////////////////
// common/v1/commmon.proto
//
// Represents any type of attribute value. AnyValue 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.
message AnyValue {
// The value is one of the listed fields. It is valid for all values to be unspecified
// in which case this AnyValue is considered to be "empty".
oneof value {
string string_value = 1;
bool bool_value = 2;
int64 int_value = 3;
double double_value = 4;
ArrayValue array_value = 5;
KeyValueList kvlist_value = 6;
bytes bytes_value = 7;
}
}
// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
// since oneof in AnyValue does not allow repeated fields.
message ArrayValue {
// Array of values. The array may be empty (contain 0 elements).
repeated AnyValue values = 1;
}
// KeyValueList is a list of KeyValue messages. We need KeyValueList as a message
// since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need
// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
// are semantically equivalent.
message KeyValueList {
// A collection of key/value pairs of key-value pairs. The list may be empty (may
// contain 0 elements).
// The keys MUST be unique (it is not allowed to have more than one
// value with the same key).
repeated KeyValue values = 1;
}
// Represents a key-value pair that is used to store Span attributes, Link
// attributes, etc.
message KeyValue {
// The key name of the pair.
string key = 1;
// The value of the pair.
AnyValue value = 2;
}
// InstrumentationScope is a message representing the instrumentation scope information
// such as the fully qualified name and version.
message InstrumentationScope {
// A name denoting the Instrumentation scope.
// An empty instrumentation scope name means the name is unknown.
string name = 1;
// Defines the version of the instrumentation scope.
// An empty instrumentation scope version means the version is unknown.
string version = 2;
// Additional attributes that describe the scope. [Optional].
// Attribute keys MUST be unique (it is not allowed to have more than one
// attribute with the same key).
repeated KeyValue attributes = 3;
// The number of attributes that were discarded. Attributes
// can be discarded because their keys are too long or because there are too many
// attributes. If this value is 0, then no attributes were dropped.
uint32 dropped_attributes_count = 4;
}
// clang-format on
#endif
//////////////////////////////////////////////////////////////////////////
namespace zen::otel {
enum class KeyValueList : protozero::pbf_tag_type
{
repeated_KeyValue_values = 1
};
enum class KeyValue : protozero::pbf_tag_type
{
string_key = 1,
AnyValue_value = 2
};
enum class Resource : protozero::pbf_tag_type
{
repeated_KeyValue_attributes = 1,
uint32_dropped_attributes_count = 2,
repeated_EntityRef_entity_refs = 3
};
enum class AnyValue : protozero::pbf_tag_type
{
string_string_value = 1,
bool_bool_value = 2,
int64_int_value = 3,
double_double_value = 4,
ArrayValue_array_value = 5,
KeyValueList_kvlist_value = 6,
bytes_bytes_value = 7
};
enum class InstrumentationScope : protozero::pbf_tag_type
{
string_name = 1,
string_version = 2,
repeated_KeyValue_attributes = 3,
uint32_dropped_attributes_count = 4
};
} // namespace zen::otel
|