Skip to content

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

Merged
reyang merged 11 commits intoopen-telemetry:mainfrom
trask:add-event-name-field
Dec 6, 2024
Merged

Change event.name attribute into top-level event name field#4320
reyang merged 11 commits intoopen-telemetry:mainfrom
trask:add-event-name-field

Conversation

@trask
Copy link
Copy Markdown
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
Comment thread specification/logs/api.md
Comment thread specification/logs/data-model.md Outdated
Comment thread specification/logs/data-model.md Outdated
@trask trask marked this pull request as ready for review December 4, 2024 21:21
@trask trask requested review from a team December 4, 2024 21:21
Comment thread specification/logs/data-model.md Outdated
Copy link
Copy Markdown
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.

Comment thread specification/logs/api.md Outdated
Comment thread specification/logs/sdk.md Outdated
Comment thread specification/logs/data-model.md Outdated
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
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.)

Comment thread specification/logs/data-model.md Outdated
Copy link
Copy Markdown
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
Copy Markdown
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
@trask trask deleted the add-event-name-field branch December 6, 2024 20:02
Comment thread specification/logs/api.md
- [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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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)

Copy link
Copy Markdown
Contributor

@chalin chalin left a comment

Choose a reason for hiding this comment

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

# Logs Data Model

**Status**: [Stable](../document-status.md)
**Status**: [Stable](../document-status.md), except where otherwise specified
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that this should be reported as:

Status: Mixed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread specification/logs/api.md
- [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
Copy Markdown
Contributor

@chalin chalin Dec 13, 2024

Choose a reason for hiding this comment

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

Note that #event-name is an invalid hash, see the website build failures in https://github.com/open-telemetry/opentelemetry.io/actions/runs/12313997571/job/34369378422?pr=5782

The hash should be #field-eventname.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, might it be better to present this as:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll send a PR to fix!

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

10 participants