opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Add EventName to LogRecord

Open DylanRussell opened this issue 7 months ago • 0 comments

The event.name attribute has been deprecated in favor of a top level EventName string field in the LogRecord.

See https://github.com/open-telemetry/opentelemetry-specification/issues/4260#issuecomment-2505119306

It no longer makes sense to have an Event class at all now.. An event is just a LogRecord with the event name field set..

I think we should revisit events, and look at the approach that they took in go lang (https://github.com/open-telemetry/opentelemetry-go/pull/6018), where the only change they made to support events was to add the EventName string field to the LogRecord.. In order to emit events, a user simply calls LoggerProvider.emit with a LogRecord that has the event name set.. That's it.

Wondering what others think of doing it that way. Given events are still in alpha, i don't think it's too late to make this change.

DylanRussell avatar Jun 18 '25 20:06 DylanRussell