You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of semantic conventions 1.28, genai events are split from spans into log events. At the moment, there is code conflation about recording of both. For example, in some cases, event_logger.emit is guarded by span.is_recording(). We should probably have a coherent approach to recording prior to adding metrics.
Describe the solution you'd like
I think data accumulated to a span should be guarded on span.is_recording(), but independent from event_logger.emit, as logging could be enabled while tracing is disabled.
So, I would like to see tests of either span or events being disabled as well both enabled and both disabled.
Moreover, we may want to obviate creation of large strings when event_logger is NoOpEventLogger or effectively disabled. I don't see a function for is_recording and unsure if an event logger provider should return NoOpEventLogger when disabled. Whatever the expectations are, could be added to a PR on https://github.com/open-telemetry/opentelemetry-python to change the python code documentation.
Describe alternatives you've considered
If for simplicitly we want to only emit log events when spans are also, that's fine but should be documented and tested.
Additional Context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered:
What problem do you want to solve?
As of semantic conventions 1.28, genai events are split from spans into log events. At the moment, there is code conflation about recording of both. For example, in some cases,
event_logger.emit
is guarded byspan.is_recording()
. We should probably have a coherent approach to recording prior to adding metrics.Describe the solution you'd like
I think data accumulated to a span should be guarded on
span.is_recording()
, but independent fromevent_logger.emit
, as logging could be enabled while tracing is disabled.So, I would like to see tests of either span or events being disabled as well both enabled and both disabled.
Moreover, we may want to obviate creation of large strings when event_logger is
NoOpEventLogger
or effectively disabled. I don't see a function foris_recording
and unsure if an event logger provider should returnNoOpEventLogger
when disabled. Whatever the expectations are, could be added to a PR on https://github.com/open-telemetry/opentelemetry-python to change the python code documentation.Describe alternatives you've considered
If for simplicitly we want to only emit log events when spans are also, that's fine but should be documented and tested.
Additional Context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: