Skip to content

Commit edccbde

Browse files
authored
all: add notes about the attribute values restrictions (#683)
1 parent a116342 commit edccbde

File tree

5 files changed

+104
-14
lines changed

5 files changed

+104
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
The full list of changes can be found in the compare view for the respective release at <https://github.com/open-telemetry/opentelemetry-proto/releases>.
66

7+
### Added
8+
9+
- all: add notes about the attribute values restrictions. [#683](https://github.com/open-telemetry/opentelemetry-proto/pull/683)
10+
711
## 1.7.0 - 2025-05-19
812

913
### Added

opentelemetry/proto/metrics/v1/metrics.proto

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,16 @@ message NumberDataPoint {
377377
// where this point belongs. The list may be empty (may contain 0 elements).
378378
// Attribute keys MUST be unique (it is not allowed to have more than one
379379
// attribute with the same key).
380+
//
381+
// The attribute values SHOULD NOT contain empty values.
382+
// The attribute values SHOULD NOT contain bytes values.
383+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
384+
// double values.
385+
// The attribute values SHOULD NOT contain kvlist values.
386+
// The behavior of software that receives attributes containing such values can be unpredictable.
387+
// These restrictions can change in a minor release.
388+
// The restrictions take origin from the OpenTelemetry specification:
389+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
380390
repeated opentelemetry.proto.common.v1.KeyValue attributes = 7;
381391

382392
// StartTimeUnixNano is optional but strongly encouraged, see the
@@ -425,6 +435,16 @@ message HistogramDataPoint {
425435
// where this point belongs. The list may be empty (may contain 0 elements).
426436
// Attribute keys MUST be unique (it is not allowed to have more than one
427437
// attribute with the same key).
438+
//
439+
// The attribute values SHOULD NOT contain empty values.
440+
// The attribute values SHOULD NOT contain bytes values.
441+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
442+
// double values.
443+
// The attribute values SHOULD NOT contain kvlist values.
444+
// The behavior of software that receives attributes containing such values can be unpredictable.
445+
// These restrictions can change in a minor release.
446+
// The restrictions take origin from the OpenTelemetry specification:
447+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
428448
repeated opentelemetry.proto.common.v1.KeyValue attributes = 9;
429449

430450
// StartTimeUnixNano is optional but strongly encouraged, see the
@@ -509,6 +529,16 @@ message ExponentialHistogramDataPoint {
509529
// where this point belongs. The list may be empty (may contain 0 elements).
510530
// Attribute keys MUST be unique (it is not allowed to have more than one
511531
// attribute with the same key).
532+
//
533+
// The attribute values SHOULD NOT contain empty values.
534+
// The attribute values SHOULD NOT contain bytes values.
535+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
536+
// double values.
537+
// The attribute values SHOULD NOT contain kvlist values.
538+
// The behavior of software that receives attributes containing such values can be unpredictable.
539+
// These restrictions can change in a minor release.
540+
// The restrictions take origin from the OpenTelemetry specification:
541+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
512542
repeated opentelemetry.proto.common.v1.KeyValue attributes = 1;
513543

514544
// StartTimeUnixNano is optional but strongly encouraged, see the
@@ -625,6 +655,16 @@ message SummaryDataPoint {
625655
// where this point belongs. The list may be empty (may contain 0 elements).
626656
// Attribute keys MUST be unique (it is not allowed to have more than one
627657
// attribute with the same key).
658+
//
659+
// The attribute values SHOULD NOT contain empty values.
660+
// The attribute values SHOULD NOT contain bytes values.
661+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
662+
// double values.
663+
// The attribute values SHOULD NOT contain kvlist values.
664+
// The behavior of software that receives attributes containing such values can be unpredictable.
665+
// These restrictions can change in a minor release.
666+
// The restrictions take origin from the OpenTelemetry specification:
667+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
628668
repeated opentelemetry.proto.common.v1.KeyValue attributes = 7;
629669

630670
// StartTimeUnixNano is optional but strongly encouraged, see the

opentelemetry/proto/profiles/v1development/profiles.proto

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,26 @@ message ProfilesDictionary {
115115
repeated string string_table = 5;
116116

117117
// A common table for attributes referenced by various messages.
118+
// It is a collection of key/value pairs. Note, global attributes
119+
// like server name can be set using the resource API. Examples of attributes:
120+
//
121+
// "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
122+
// "/http/server_latency": 300
123+
// "abc.com/myattribute": true
124+
// "abc.com/score": 10.239
125+
//
126+
// Attribute keys MUST be unique (it is not allowed to have more than one
127+
// attribute with the same key).
128+
//
129+
// The attribute values SHOULD NOT contain empty values.
130+
// The attribute values SHOULD NOT contain bytes values.
131+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
132+
// double values.
133+
// The attribute values SHOULD NOT contain kvlist values.
134+
// The behavior of software that receives attributes containing such values can be unpredictable.
135+
// These restrictions can change in a minor release.
136+
// The restrictions take origin from the OpenTelemetry specification:
137+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
118138
repeated opentelemetry.proto.common.v1.KeyValue attribute_table = 6;
119139

120140
// Represents a mapping between Attribute Keys and Units.
@@ -272,18 +292,6 @@ message Profile {
272292
bytes original_payload = 12;
273293

274294
// References to attributes in attribute_table. [optional]
275-
// It is a collection of key/value pairs. Note, global attributes
276-
// like server name can be set using the resource API. Examples of attributes:
277-
//
278-
// "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
279-
// "/http/server_latency": 300
280-
// "abc.com/myattribute": true
281-
// "abc.com/score": 10.239
282-
//
283-
// The OpenTelemetry API specification further restricts the allowed value types:
284-
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute
285-
// Attribute keys MUST be unique (it is not allowed to have more than one
286-
// attribute with the same key).
287295
repeated int32 attribute_indices = 13;
288296
}
289297

opentelemetry/proto/resource/v1/resource.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ message Resource {
2929
// Set of attributes that describe the resource.
3030
// Attribute keys MUST be unique (it is not allowed to have more than one
3131
// attribute with the same key).
32+
//
33+
// The attribute values SHOULD NOT contain empty values.
34+
// The attribute values SHOULD NOT contain bytes values.
35+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
36+
// double values.
37+
// The attribute values SHOULD NOT contain kvlist values.
38+
// The behavior of software that receives attributes containing such values can be unpredictable.
39+
// These restrictions can change in a minor release.
40+
// The restrictions take origin from the OpenTelemetry specification:
41+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
3242
repeated opentelemetry.proto.common.v1.KeyValue attributes = 1;
3343

3444
// dropped_attributes_count is the number of dropped attributes. If the value is 0, then

opentelemetry/proto/trace/v1/trace.proto

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,18 @@ message Span {
206206
// "example.com/myattribute": true
207207
// "example.com/score": 10.239
208208
//
209-
// The OpenTelemetry API specification further restricts the allowed value types:
210-
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute
211209
// Attribute keys MUST be unique (it is not allowed to have more than one
212210
// attribute with the same key).
211+
//
212+
// The attribute values SHOULD NOT contain empty values.
213+
// The attribute values SHOULD NOT contain bytes values.
214+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
215+
// double values.
216+
// The attribute values SHOULD NOT contain kvlist values.
217+
// The behavior of software that receives attributes containing such values can be unpredictable.
218+
// These restrictions can change in a minor release.
219+
// The restrictions take origin from the OpenTelemetry specification:
220+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
213221
repeated opentelemetry.proto.common.v1.KeyValue attributes = 9;
214222

215223
// dropped_attributes_count is the number of attributes that were discarded. Attributes
@@ -230,6 +238,16 @@ message Span {
230238
// attributes is a collection of attribute key/value pairs on the event.
231239
// Attribute keys MUST be unique (it is not allowed to have more than one
232240
// attribute with the same key).
241+
//
242+
// The attribute values SHOULD NOT contain empty values.
243+
// The attribute values SHOULD NOT contain bytes values.
244+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
245+
// double values.
246+
// The attribute values SHOULD NOT contain kvlist values.
247+
// The behavior of software that receives attributes containing such values can be unpredictable.
248+
// These restrictions can change in a minor release.
249+
// The restrictions take origin from the OpenTelemetry specification:
250+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
233251
repeated opentelemetry.proto.common.v1.KeyValue attributes = 3;
234252

235253
// dropped_attributes_count is the number of dropped attributes. If the value is 0,
@@ -262,6 +280,16 @@ message Span {
262280
// attributes is a collection of attribute key/value pairs on the link.
263281
// Attribute keys MUST be unique (it is not allowed to have more than one
264282
// attribute with the same key).
283+
//
284+
// The attribute values SHOULD NOT contain empty values.
285+
// The attribute values SHOULD NOT contain bytes values.
286+
// The attribute values SHOULD NOT contain array values different than array of string values, bool values, int values,
287+
// double values.
288+
// The attribute values SHOULD NOT contain kvlist values.
289+
// The behavior of software that receives attributes containing such values can be unpredictable.
290+
// These restrictions can change in a minor release.
291+
// The restrictions take origin from the OpenTelemetry specification:
292+
// https://github.com/open-telemetry/opentelemetry-specification/blob/v1.47.0/specification/common/README.md#attribute.
265293
repeated opentelemetry.proto.common.v1.KeyValue attributes = 4;
266294

267295
// dropped_attributes_count is the number of dropped attributes. If the value is 0,

0 commit comments

Comments
 (0)