-
Notifications
You must be signed in to change notification settings - Fork 620
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
elasticsearch: don't produce spans if native elasticsearch support is enabled #2524
Conversation
cc @pquentin |
86a4fe5
to
0101e91
Compare
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.
Thanks for this Riccardo! I wonder, though, should we add a warning in that case?
The native instrumentation is more correct, following the semantic conventions, but also very different. If you install this package and elasticsearch-py 8.13+, you're going to be very surprised. So a warning saying to uninstall opentelemetry-instrumentation-elasticsearch because it does not cover elasticsearch-py 8.13+ would be useful IMO.
I can add that only if we have a rate limited logger because we are still checking the span at each perform request call
Will add something to the documentation |
Warnings are deduplicated already, you can run this example to see for yourself: import warnings
def deprecated_api(message):
warnings.warn(message, Warning, stacklevel=2)
for i in range(10):
deprecated_api("test") |
… enabled If elasticsearch is found with native OTel support enabled just call the wrapped function without creating our own spans. Fix open-telemetry#2393
0101e91
to
fefb005
Compare
Updated PR: fixed typo in env variables, added warning to the docs and code, limited tests with native Otel to elasticsearch > 8.13 |
...ry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py
Outdated
Show resolved
Hide resolved
...ry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py
Outdated
Show resolved
Hide resolved
9dd86c9
to
3f71d2d
Compare
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.
Thanks! LGTM.
...ry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py
Outdated
Show resolved
Hide resolved
...ry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py
Outdated
Show resolved
Hide resolved
…c/opentelemetry/instrumentation/elasticsearch/__init__.py
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.
Thanks for comments as well
Description
If elasticsearch is found with native OTel support enabled just call the wrapped function without creating our own spans.
Fixes #2393
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.