Skip to content

Conversation

@pellared
Copy link
Member

@pellared pellared commented Jul 17, 2025

Blocked by:

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

To be precise:

- **Complex attributes** include all other values supported by the `AnyValue` proto,
such as null (empty) value, maps, heterogeneous arrays, and combinations of those with primitives.
Byte arrays are also considered complex attributes, as they are excluded from
the current definition of *standard* attributes.
- **AnyValue** represents the type of *any* (simple or complex) attribute value on
the API, SDK, and [proto level](https://github.com/open-telemetry/opentelemetry-proto/blob/42319f8b5bf330f7c3dd4a097384f9f6d5467450/opentelemetry/proto/common/v1/common.proto#L28-L40).
It's also known as `any` in the [Log data model](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.44.0/specification/logs/data-model.md#type-any)

It is also worth mentioning that it is already allowed by OTLP:

message AnyValue {
  // The value is one of the listed fields. It is valid for all values to be unspecified
  // in which case this AnyValue is considered to be "empty".
  oneof value {

Prototype:

Also fixes #4468

as it removes the portion which said that extending the attribute types is a breaking change as it was already approved via #4485.

This is necessary to be able to represent an empty (that is the default) Log Record Body using "Standard Attributes".

This is needed towards stabilization of OTel Go Logs API and SDK (we need it "stable" though; not only "development"); more:

I also checked the stable Logs API implementations (according to https://opentelemetry.io/status) and none of them seem to be strictly compliant with the specification in regards of Log Record Body value:

@pellared pellared self-assigned this Jul 17, 2025
@pellared pellared moved this from Todo to In Progress in Go: Logs (GA) Jul 17, 2025
@pellared pellared moved this to In progress in Logs SIG Jul 17, 2025
@pellared pellared added the maintainer-request Escalated by SIG maintainers label Jul 17, 2025
@pellared
Copy link
Member Author

CC @open-telemetry/go-maintainers

@pellared pellared marked this pull request as ready for review July 17, 2025 21:49
@pellared pellared requested review from a team July 17, 2025 21:49
@pellared pellared changed the title Add empty value to attribute Add empty value attribute Jul 17, 2025
external log APIs, which do not necessarily have the same value type
restrictions as the standard attribute definition.

Note: Extending the set of standard attribute value types is a breaking change.
Copy link
Member

@lmolkova lmolkova Jul 18, 2025

Choose a reason for hiding this comment

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

I think we need to start with proto changes and replace comments like https://github.com/open-telemetry/opentelemetry-proto/blob/be5d58470429d0255ffdd49491f0815a3a63d6ef/opentelemetry/proto/trace/v1/trace.proto#L209-L213

// The OpenTelemetry API specification further restricts the allowed value types:
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute
// Attribute keys MUST be unique (it is not allowed to have more than one
// attribute with the same key).

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

we probably need to replace it with comment that they are going to be allowed in 6 months

- Stable exporters will be prohibited from emitting complex attributes by default on signals
other than Logs until at least 6 months after this OTEP is merged.


Or, at least, leave a note here that complex attributes are coming and their support is in development, nobody should stabilize them in the next 6 month.

Copy link
Member Author

@pellared pellared Jul 18, 2025

Choose a reason for hiding this comment

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

we probably need to replace it with comment that they are going to be allowed in 6 months

I feel like this is an orthogonal PR given the changes of https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute are marked with Development status.

Moreover, this PR does not make the existing comment invalid and should block this PR.

Therefore, I think a PR in proto repo can be done in parallel.
I am not sure how we want to update the comment in proto repo as of today.
Are you able to help with it?

EDIT: I tried to come up with a PR in the proto repo. PTAL:

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed in the SIG meeting, we agreed to reintroduce this "note" in this PR, since it’s clearer to handle the broader change in a separate PR. That separate PR will:

  • communicate that we’ve revised the decision and will now allow the addition of new attribute types (which is not considered a major change),
  • clarify that introducing new attribute types will require a minor version bump in the OTLP (proto) repository.

This PR will be blocked until that separate PR is merged.

Copy link
Member Author

Choose a reason for hiding this comment

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

I created #4602 for tracking.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lmolkova, can you please block this PR (request changes) with e.g. following comment:

Blocked by:
- https://github.com/open-telemetry/opentelemetry-specification/issues/4602

so that it is not accidentally merged?

@pellared pellared changed the title Add empty value attribute [Blocked] Add empty value attribute Jul 22, 2025
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jul 31, 2025
@pellared pellared removed the Stale label Jul 31, 2025
@github-actions
Copy link

github-actions bot commented Aug 8, 2025

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 8, 2025
@pellared pellared removed the Stale label Aug 8, 2025
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 16, 2025
@pellared pellared removed the Stale label Aug 18, 2025
@pellared pellared requested review from a team as code owners August 26, 2025 13:48
@github-actions
Copy link

github-actions bot commented Sep 3, 2025

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 3, 2025
@pellared pellared removed the Stale label Sep 3, 2025
@aabmass
Copy link
Member

aabmass commented Sep 4, 2025

Looks like this addresses #4392, but maybe some of the concerns like a KeyValue with null value are still left up to interpretation.

@pellared
Copy link
Member Author

pellared commented Sep 8, 2025

Looks like this addresses #4392, but maybe some of the concerns like a KeyValue with null value are still left up to interpretation.

Please see my answer in #4392

@pellared
Copy link
Member Author

pellared commented Sep 8, 2025

I prefer to go forward with #4651 instead of this one (to hopefully move a little faster).

@pellared pellared closed this Sep 10, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Logs SIG Sep 10, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Go: Logs (GA) Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-request Escalated by SIG maintainers

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

Review the language around standard attributes (and breaking changes)

4 participants