Skip to content

Conversation

@pellared
Copy link
Member

@pellared pellared commented Aug 26, 2025

Related spec PRs:

Towards open-telemetry/opentelemetry-specification#4602

Follows open-telemetry/opentelemetry-specification#4614

Per https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/4485-extending-attributes-to-support-complex-values.md#proto

We are dropping the attributes values restriction.
Receivers of OTLP (most probably) v1.9.0 are expected to handle attribute values which before were expected only in logs signal (like complex values, bytes, or empty value).

See Copilot's description: #707 (review)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes attribute value restrictions from the OpenTelemetry protocol definitions, allowing receivers to handle complex values that were previously restricted. This change aligns with the OpenTelemetry specification's extension to support complex attribute values.

  • Removes SHOULD NOT restrictions on empty values, bytes values, complex arrays, and kvlist values from attribute documentation
  • Adds consistent warning about unpredictable behavior when duplicate keys are received
  • Updates changelog to document the breaking change

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
opentelemetry/proto/trace/v1/trace.proto Removes attribute value restrictions from span, event, and link attributes
opentelemetry/proto/resource/v1/resource.proto Removes attribute value restrictions from resource attributes
opentelemetry/proto/profiles/v1development/profiles.proto Removes attribute value restrictions from profile attributes
opentelemetry/proto/metrics/v1/metrics.proto Removes attribute value restrictions from metric data points and adds duplicate key warning
opentelemetry/proto/logs/v1/logs.proto Adds duplicate key warning to log record attributes
opentelemetry/proto/common/v1/common.proto Adds duplicate key warnings to KeyValueList and InstrumentationScope
CHANGELOG.md Documents the breaking change in the changelog

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pellared pellared changed the title all: drop attribute values restrictions [Blocked] all: drop attribute values restrictions Aug 26, 2025
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approved, but blocking to prevent accidental merging before 1.8.0

@pellared pellared marked this pull request as ready for review August 26, 2025 17:53
@pellared
Copy link
Member Author

pellared commented Aug 29, 2025

I added a more visible notice in changelog for OTLP consumers (e.g. vendors) (be16ea5, 6ea1f91) per @MrAlias offline suggestion.

@pellared pellared changed the title [Blocked] all: drop attribute values restrictions all: drop attribute values restrictions Sep 2, 2025
@pellared
Copy link
Member Author

pellared commented Sep 2, 2025

I approved, but blocking to prevent accidental merging before 1.8.0

@tigrannajaryan , it can be unblocked per https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v1.8.0. Thanks a lot for your help 👍

@tigrannajaryan tigrannajaryan dismissed their stale review September 2, 2025 15:29

Block not needed anymore.

@pellared pellared requested a review from jhalliday September 3, 2025 06:58
@lmolkova lmolkova merged commit 9815b34 into open-telemetry:main Oct 27, 2025
17 checks passed
@pellared pellared deleted the rem-attr-type-restr branch October 28, 2025 05:41
github-merge-queue bot pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Oct 28, 2025
## Changes

- Introduce of `AnyValue` type supporting complex data structures (empty
value, byte arrays, heterogeneous arrays and maps).
- Consolidate of attribute definitions across signals to use the unified
`AnyValue` type.
- Update attribute limits to accommodate new value types.
- Allow attribute collections to contain duplicate keys via an opt-in
configuration (as this is [allowed for log
attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#type-mapstring-any)).
- Remove "standard attribute" terminology in favor of general
"attribute".

### Extend attribute types

Prior-art (this PR guides towards this):
#4636

Prototype: open-telemetry/opentelemetry-go#6809

Follows
#4614

Related to
#4602

Related proto PR:
open-telemetry/opentelemetry-proto#707


https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/4485-extending-attributes-to-support-complex-values.md#how
describes how languages should add support for new attribute value
types.

Closes
#4460
(no longer needed - feature is removed)

### OTEP changes

Notice that this PR has changed the strategy for
https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/4485-extending-attributes-to-support-complex-values.md#api
from:

> OTel API **MAY** support setting complex attributes on metrics,
resources, instrumentation scope, span events, and as identifying entity
attribute

to simply:

> OTel API **MUST** support setting complex attribute.

This is the agreement up to this point:
#4651 (comment)

The other change in the OTEP is because of
#4651 (comment).

### Attribute limit updates

Towards
#4487

This also proposes **minimal and non-breaking** additions for the
attribute limits:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/4485-extending-attributes-to-support-complex-values.md#attribute-limits.

The proposal for **attribute count limit** is proposed because of
#4651 (comment).

- **Predictability:** Users can more easily understand and predict when
they'll hit the limit. Especially given the existing behavior of
attribute count limit.
- **Practical usage:** Maps are typically used as cohesive units of
related data, so counting them as single attributes aligns with their
semantic purpose. Without this rule, a single map attribute with many
internal key-value pairs could quickly exhaust the attribute count
limit, which would be surprising behavior for users.

The proposal for **attribute value length limit** seems the most logical
to me.

## Comments to be addressed as followups

I am going to create issues to be created after this is PR merged:

-
#4651 (comment)
-
#4651 (comment)
-
#4651 (comment)

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Liudmila Molkova <neskazu@gmail.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.