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

openai: add behavior tests for span and logs disabled #3030

Open
codefromthecrypt opened this issue Nov 20, 2024 · 0 comments
Open

openai: add behavior tests for span and logs disabled #3030

codefromthecrypt opened this issue Nov 20, 2024 · 0 comments

Comments

@codefromthecrypt
Copy link
Contributor

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 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

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

No branches or pull requests

1 participant