Skip to content

Commit

Permalink
Clarify that attribute keys are unique in collections
Browse files Browse the repository at this point in the history
Attributes keys must be unique. The key/value pair collections in the specification
was always intended to model a map.

There was a recent confusion about this. This change clarifies the spec.

Resolves open-telemetry#2245
  • Loading branch information
tigrannajaryan committed Jan 6, 2022
1 parent 8e29f55 commit 52d4a88
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions specification/common/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Attribute](#attribute)
* [Attribute Limits](#attribute-limits)
+ [Exempt Entities](#exempt-entities)
- [Attribute Collections](#attribute-collections)

<!-- tocstop -->

Expand Down Expand Up @@ -105,3 +106,14 @@ attribute limits for Resources.
Attributes, which belong to Metrics, are exempt from the limits described above
at this time, as discussed in
[Metrics Attribute Limits](../metrics/sdk.md#attribute-limits).

## Attribute Collections

[Resources](../resource/sdk.md),
Metrics [data points](../metrics/datamodel.md#metric-points),
[Spans](../trace/api.md#set-attributes),
Span [Events](../trace/api.md#add-events),
Span [Links](../trace/api.md#specifying-links)
and [Log Records](../logs/data-model.md) may contain a collection of attributes.
The keys in each such collection are unique, i.e. there cannot exist more than
one key-value pair with the same key.

0 comments on commit 52d4a88

Please sign in to comment.