Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f7d265d
recommend JSON object encoding for attribute debugging
pellared Apr 15, 2026
cafff95
add PR number
pellared Apr 15, 2026
b7156b2
enhance examples
pellared Apr 20, 2026
864d0d7
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 20, 2026
33a3220
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 22, 2026
dc96379
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 24, 2026
6406205
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 24, 2026
dea3de4
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 27, 2026
dccd5bb
Avoid duplicating AnyValue non-OTLP encoding rules
pellared Apr 27, 2026
c04789f
refine section
pellared Apr 27, 2026
bc48da2
Update CHANGELOG.md
pellared Apr 27, 2026
6eb91fa
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 28, 2026
c3305ba
Update specification/common/README.md
pellared Apr 28, 2026
1f3c2e1
Update CHANGELOG.md
pellared Apr 28, 2026
e42169b
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 28, 2026
a29f6e1
Merge branch 'main' into key-anyvalue-tuple-representation
pellared Apr 29, 2026
43982ab
Merge branch 'main' into key-anyvalue-tuple-representation
pellared May 4, 2026
3d1ad40
Merge branch 'main' into key-anyvalue-tuple-representation
pellared May 7, 2026
f1c82d5
Merge branch 'main' into key-anyvalue-tuple-representation
pellared May 7, 2026
c319aac
Merge branch 'main' into key-anyvalue-tuple-representation
pellared May 18, 2026
48db8d3
Merge branch 'main' into key-anyvalue-tuple-representation
pellared May 18, 2026
dd5f562
Merge branch 'main' into key-anyvalue-tuple-representation
pellared May 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ release.

### Common

- Add in-development guidance recommending a JSON object as the string
representation for an attribute in non-OTLP or debugging contexts.
([#8205](https://github.com/open-telemetry/opentelemetry-specification/pull/8205))
Comment thread
pellared marked this conversation as resolved.
Outdated

### OpenTelemetry Protocol

### Compatibility
Expand Down
36 changes: 36 additions & 0 deletions specification/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ path_base_for_github_subdir:
+ [Arrays](#arrays)
+ [Maps](#maps)
- [Attribute](#attribute)
* [Attribute representation for non-OTLP](#attribute-representation-for-non-otlp)
* [Attribute Collections](#attribute-collections)
- [Attribute Limits](#attribute-limits)
* [Configurable Parameters](#configurable-parameters)
Expand Down Expand Up @@ -195,6 +196,41 @@ See [Requirement Level](https://github.com/open-telemetry/semantic-conventions/b
See [this document](attribute-type-mapping.md) to find out how to map values obtained
outside OpenTelemetry into OpenTelemetry attribute values.

### Attribute representation for non-OTLP
Comment thread
bogdandrutu marked this conversation as resolved.

**Status**: [Development](../document-status.md)

For non-OTLP protocols or other debugging-oriented contexts that need to
Comment thread
pellared marked this conversation as resolved.
Outdated
represent a single `Attribute` as a string, the RECOMMENDED form is a JSON
Comment thread
pellared marked this conversation as resolved.
Outdated
object containing a single key-value pair.

> [!NOTE]
> This string representation is lossy. Type information is lost as all
Comment thread
pellared marked this conversation as resolved.
> values are converted to strings, and precision loss may occur for numeric values
> (particularly for floating point numbers and large integers that exceed the
> precision capabilities of the receiving system's string-to-number conversion).

The `key` portion SHOULD be represented as a
[JSON string](https://datatracker.ietf.org/doc/html/rfc8259#section-7) member
name.

The `value` portion SHOULD use the JSON representation that corresponds to the
attribute value:

- strings as JSON strings,
- booleans as JSON booleans,
- integers and floating point numbers as JSON numbers, except that `NaN`,
Comment thread
pellared marked this conversation as resolved.
Outdated
`Infinity`, and `-Infinity` SHOULD be represented as JSON strings,
- byte arrays as [Base64-encoded](https://datatracker.ietf.org/doc/html/rfc4648#section-4)
JSON strings,
- arrays as JSON arrays,
- maps as JSON objects,
- empty values as JSON null.
Comment thread
pellared marked this conversation as resolved.
Outdated

Examples: `{"http.request.method": "GET"}`, `{"retries": 3}`,
`{"payload": "aGVsbG8gd29ybGQ="}`, `{"session.id": null}`,
`{"colors": ["red", "blue"]}`, `{"context": {"nested": true}}`

### Attribute Collections

[Resources](../resource/sdk.md),
Expand Down
Loading