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

Change event.name attribute into top-level event name field #4320

Merged
merged 11 commits into from
Dec 6, 2024

Conversation

trask
Copy link
Member

@trask trask commented Dec 4, 2024

Fixes #4260

Changes

Converts event name from an attribute (event.name) into a top-level field.

@trask trask force-pushed the add-event-name-field branch from 3f68017 to e994c1b Compare December 4, 2024 19:16
@trask trask marked this pull request as ready for review December 4, 2024 21:21
@trask trask requested review from a team as code owners December 4, 2024 21:21
Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

LGTM, I left a nonblocking comment.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

💯 Looks good!
(coming from .NET, C++, Rust clients where EventName was a top-level field all the time.)

specification/logs/data-model.md Outdated Show resolved Hide resolved
Copy link
Member

@XSAM XSAM left a comment

Choose a reason for hiding this comment

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

I like this design ❤️

@cijothomas cijothomas mentioned this pull request Dec 6, 2024
Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

+1 for this. Rust tokio tracing library already has "event name" as top-level field. Would be easy to model this into otel-rust with this change.

@reyang reyang merged commit a265ae0 into open-telemetry:main Dec 6, 2024
6 checks passed
@trask trask deleted the add-event-name-field branch December 6, 2024 20:02
@@ -137,6 +137,7 @@ The API MUST accept the following parameters:
- [Severity Text](./data-model.md#field-severitytext) (optional)
- [Body](./data-model.md#field-body) (optional)
- [Attributes](./data-model.md#field-attributes) (optional)
- **Status**: [Development](../document-status.md) - [Event Name](./data-model.md#event-name) (optional)
Copy link
Member

Choose a reason for hiding this comment

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

Looks like I'm late to the game, but here's some thoughts...

  • In .NET ILogger API we have CategoryName always and optional EventId structure (which contains Name & Id). So what goes here? EventId.Name may not be present and if it is, presumably, it is only unique the context of a CategoryName. So should this be prefixed? EventName = $"{CategoryName}.{EventName}" or do we also need something like EventNamespace defined?

  • Seems odd to introduce "Event" into the Log API given there is an "Event" API defined right below. Seems to invite confusion 😄 Why not just "Name" here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems odd to introduce "Event" into the Log API given there is an "Event" API defined right below

check out discussions at https://cloud-native.slack.com/archives/C062HUREGUV/p1733358994263159

since it's low level API it should support all logs features (including events), so it should take a name

and https://cloud-native.slack.com/archives/C062HUREGUV/p1733398117155609

The whole reason why the Go SIG was asking that the "Emit an Event" should be optional in the OTEP (see: open-telemetry/oteps#265 (comment)) is that after spending about a year designing the Logs API and SDK we felt that adding a separate method is a wrong decision.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why not just "Name" here?

it's going to map to new proto field event_name (open-telemetry/opentelemetry-proto#600)

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.

Add EventName to Log and Event Record in data model
9 participants