-
Notifications
You must be signed in to change notification settings - Fork 295
all: drop attribute values restrictions #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 NOTrestrictions 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.
There was a problem hiding this 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
@tigrannajaryan , it can be unblocked per https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v1.8.0. Thanks a lot for your help 👍 |
## 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>
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.0are 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)