Skip to content
Closed
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ release.

- ⚠️ **IMPORTANT**: Extending the set of standard attribute value types is no longer a breaking change.
([#4614](https://github.com/open-telemetry/opentelemetry-specification/pull/4614))
- Add empty value attribute.
([#4595](https://github.com/open-telemetry/opentelemetry-specification/pull/4595))

### Supplementary Guidelines

Expand Down
12 changes: 5 additions & 7 deletions specification/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ path_base_for_github_subdir:

# Common specification concepts

**Status**: [Stable](../document-status.md)
**Status**: [Stable](../document-status.md), except where otherwise specified

<details>
<summary>Table of Contents</summary>
Expand Down Expand Up @@ -38,15 +38,13 @@ An `Attribute` is a key-value pair, which MUST have the following properties:
- A primitive type: string, boolean, double precision floating point (IEEE 754-1985) or signed 64 bit integer.
- An array of primitive type values. The array MUST be homogeneous,
i.e., it MUST NOT contain values of different types.
- **Status**: [Development](../document-status.md) - An empty value (e.g. `null`).

For protocols that do not natively support non-string values, non-string values SHOULD be represented as JSON-encoded strings. For example, the expression `int64(100)` will be encoded as `100`, `float64(1.5)` will be encoded as `1.5`, and an empty array of any type will be encoded as `[]`.

Attribute values expressing a numerical value of zero, an empty string, or an
empty array are considered meaningful and MUST be stored and passed on to
processors / exporters.

Attribute values of `null` are not valid and attempting to set a `null` value is
undefined behavior.
Attribute values expressing an empty value, a numerical value of zero,
an empty string, or an empty array are considered meaningful and MUST be stored
and passed on to processors / exporters.

`null` values SHOULD NOT be allowed in arrays. However, if it is impossible to
make sure that no `null` values are accepted
Expand Down
7 changes: 7 additions & 0 deletions specification/common/attribute-type-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ linkTitle: Mapping to AnyValue

- [Converting to AnyValue](#converting-to-anyvalue)
* [Primitive Values](#primitive-values)
+ [Empty Value](#empty-value)
+ [Integer Values](#integer-values)
+ [Enumerations](#enumerations)
+ [Floating Point Values](#floating-point-values)
Expand Down Expand Up @@ -54,6 +55,12 @@ follow the rules described below.

### Primitive Values

#### Empty Value

Empty values MUST be converted to AnyValue with no
[value](https://github.com/open-telemetry/opentelemetry-proto/blob/38b5b9b6e5257c6500a843f7fdacf89dd95833e8/opentelemetry/proto/common/v1/common.proto#L28-L30)
field being set.

#### Integer Values

Integer values which are within the range of 64 bit signed numbers
Expand Down
Loading