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

Deprecate event.name attribute in favor of EventName on the log record #1646

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lmolkova
Copy link
Contributor

@lmolkova lmolkova commented Dec 3, 2024

Part of open-telemetry/opentelemetry-specification#4260

Logs SIG is working on migrating from event.name attribute to EventName field on LogRecord. This is a WIP that depends on the

Creating it to socialize the proposal and gather high-level feedback.

Semantic conventions that depend on event.name (over-the-wire):

Transition

event.name is an experimental attribute and de-facto is used by new-ish conventions and instrumentation libraries.

So we (Logs SIG) believe no common transition/migration plan is necessary, but individual instrumentation libraries can provide back-compat story.

  • Instrumentations that produce events using explicit event.name attribute can do a breaking change and start using LogRecord.EventName property instead of the attribute. It's up to each instrumentation component to provide (or not provide) transition story.
  • Telemetry consumers should expect to receive deprecated event.name attribute, new LogRecord.EventName property or both. When both are present, the LogRecord.EventName should be used as a source of truth.

Future

Instead of deprecating event.name, we might want to reserve it for bridges similarly to otel.status_code. E.g. when users want to report event using logging bridge and the logging facade does not have a notion of event name, the event.name attribute maybe used by the end users and translated to top-level LogRecord property by the adapter.

Deprecating the attribute is reversible, so I'd prefer to do it now and tackle compatibility with external logging libs separately.

Merge requirement checklist

Copy link
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

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

I know it's still just draft, but this seems fine.

@@ -87,15 +67,15 @@ Recommendations on using attributes vs. body fields:

* If the field should be comparable across every type of record, it should be an attribute.
* If the field is specific to the event itself, then it should be a body field.
* Unless the same `event.name` exists on two events, anything in two event bodies is not comparable to each other.
* Unless two events share the same `EventName` property value, anything in two event bodies is not comparable to each other.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should reword the "two events" definition, as now it reads (to me) more specific than the previous trailing "two events"... Perhaps something like
(really just removing the "two" qualification as someone is likely to ask the question of what about if three, four, five events etc.)

"Unless the EventName property value matches, any fields or values within event bodies that share the same name or path should not be considered comparable."

With maybe a qualifier "Unless explicitly called out by the specific event definition" (or we can leave this out as edge cases (which they are).

And maybe a general follow up qualification about case-sensitivity (although I'm assuming that by keeping the above comments about Event names are subject to the same rules as [attribute names](/docs/general/attribute-naming.md) this "should" avoid this question... (Hopefully)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the text, ptal

@lmolkova lmolkova marked this pull request as ready for review December 12, 2024 04:24
@lmolkova lmolkova force-pushed the deprecate-event-name-attribute branch from adf6a98 to 75746bc Compare December 12, 2024 04:59
@lmolkova lmolkova requested a review from a team as a code owner December 12, 2024 04:59

* An event MUST have an `event.name` attribute that uniquely identifies the event.
* It MAY have [standard](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.39.0/specification/common#attribute)
* An event MUST have an [Event name property](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.40.0/specification/logs/data-model.md#field-eventname)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

spec 1.40.0 release is pending, let's wait for it to land

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants