Skip to content
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

Support complex attributes in the Event API #4334

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ release.
([#4301](https://github.com/open-telemetry/opentelemetry-specification/pull/4301))
- Change `event.name` attribute into top-level event name field.
([#4320](https://github.com/open-telemetry/opentelemetry-specification/pull/4320))
- Support complex attributes in the Event API
([#4334](https://github.com/open-telemetry/opentelemetry-specification/pull/4334))

### Events

Expand Down
3 changes: 1 addition & 2 deletions specification/logs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ formatted as an [event](./data-model.md#events).
* [Severity Number](./data-model.md#field-severitynumber) (optional)
* [Severity Text](./data-model.md#field-severitytext) (optional)
* [Body](./data-model.md#field-body) (optional)
* [Attributes](./data-model.md#field-attributes) (optional) Event `Attributes` conform
to the [standard definition](../common/README.md#standard-attribute) of an attribute.
* [Attributes](./data-model.md#field-attributes) (optional)
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 wonder if we can limit this to standard attributes plus "maps" and "arrays of maps"

where map values can be

  • primitives
  • heterogenous array of primitives
  • maps
  • array of maps

in other words, do we need these?

  • non-heterogeneous arrays
  • arrays of arrays

Copy link
Member

@pellared pellared Dec 15, 2024

Choose a reason for hiding this comment

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

I think that such limitation would just add more complexity given that EmitLogRecord needs to support it.

Having different abstractions for log and event attributes seems an overkill.

Copy link
Contributor

@lmolkova lmolkova Dec 15, 2024

Choose a reason for hiding this comment

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

Agree with @pellared. If backends provide ergonomics/optimizations for maps, it'll be a good motivation for users to use maps. Adding artificial limitation forces to have different attribute types (#4201) and increases complexity.

But I support these limitations on the semconv side. I'd even consider limiting semconv-supported types to something that can be flattened to a set of standard attributes (i.e. no arrays with complex types).


## Optional and required parameters

Expand Down
Loading