-
Notifications
You must be signed in to change notification settings - Fork 655
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
Create Suppress HTTP Instrumentation key in opentelemetry context #2729
Merged
lzchen
merged 9 commits into
open-telemetry:main
from
carolabadeer:fix-suppress-http-instrumentation-key
Jun 16, 2022
Merged
Create Suppress HTTP Instrumentation key in opentelemetry context #2729
lzchen
merged 9 commits into
open-telemetry:main
from
carolabadeer:fix-suppress-http-instrumentation-key
Jun 16, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Merged
6 tasks
lzchen
reviewed
Jun 13, 2022
lzchen
approved these changes
Jun 13, 2022
ocelotl
approved these changes
Jun 13, 2022
eaidland
pushed a commit
to equinor/omnia-timeseries-python
that referenced
this pull request
Jul 8, 2022
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
This change aims to fix the issue outlined in opentelemetry-python-contrib issue #930 where urllib3 downstream spans are not being suppressed with a requests upstream, causing an extra span to be created.
The root cause of this bug lies in the create_key() method in opentelemetry context which adds a unique
uuid
to the end of each key created. Since a new_SUPPRESS_HTTP_INSTRUMENTATION
key is being created in the instrumentation for each library, this results in a different key being created by each instrumentation instead of the creation of a single key that suppresses HTTP instrumentation so proceeding libraries know not to instrument further.This fix involves creating the
_SUPPRESS_HTTP_INSTRUMENTATION
once in opentelemetry context to avoid the bug that causes a new suppress http instrumentation key to be created by each instrumentation. By having only 1 key that is accessible to all instrumentations, its true value can be passed on from one instrumentation to the next without being set to None every time the instrumentation of a new library begins. This does not conflict with the context spec since the_SUPPRESS_HTTP_INSTRUMENTATION_KEY
is meant to be shared, and creating a unique version of it in each library instrumentation is not the correct implementation of this concept.Fixes #930 in opentelemetry-python-contrib
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 Contrib Repo Change?
Checklist: