-
Notifications
You must be signed in to change notification settings - Fork 799
Record content events regardless of span sampling decision #3226
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the owners know after this change we'll get the conversion overhead always, and that can be quite large if there's a large context.
Follow-up notes:
There's little to do about this while we still depend on event_logger. Singe event_logger is deprecated, there's no sense in adding a sampling function to it. Since it could be wrapped, testing if it is noop may have limited benefit.
When things move to a logger base api, it could be possible to optimize this to check if
- active span is sampled
- a corresponding log scope is enabled
in either case, do the overhead and when neither, don't.
...mentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_async_chat_completions.py
Outdated
Show resolved
Hide resolved
...mentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_async_chat_completions.py
Outdated
Show resolved
Hide resolved
instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_chat_completions.py
Outdated
Show resolved
Hide resolved
...opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py
Outdated
Show resolved
Hide resolved
...opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py
Outdated
Show resolved
Hide resolved
There are a bunch of spec-level changes in discussions that would make it all possible. For now the best we can do in python is to implement logger.is_enabled that'd return false if logs SDK is not configured - created open-telemetry/opentelemetry-python#4410 to track. |
Fixes #3217
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.