-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: OTEL context lost in subthreads of parallel bulk calls #2616
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
86c7498
fix: forward OTEL context to subthreads in parallel bulk calls
c88e548
test: add scenario for OTEL context forwarding in parallel bulk
041d841
lint: isort import order and black formatting
31c0b8d
fix: add missing type hints
1f2dd49
Add _otel attribute to FailingBulkClient
pquentin 3f73592
Restore version
pquentin ee1468e
fix: review suggestions, renaming and except guard
a763272
fix: optionally inject OTEL context
3ac91b6
Merge branch 'main' into main
795d1bf
Remove 3.7 in nox otel session
pquentin 7cfad71
Switch from span(inject_context) to helpers_span
pquentin 9eb549a
Create OpenTelemetry parent traces for all sync bulk helpers
pquentin 751b811
Fix lint
pquentin 464b306
Fix _recover_parent_context without OTel
pquentin 49096df
Merge branch 'main' into main
a0689c8
Switch test_otel to sync_client
pquentin 6dbe873
Switch away from global tracer
pquentin 4de4315
Test all bulks
pquentin 280251d
Fix url.full comparison
pquentin 5dcec1a
Fix attribute check again
pquentin a91e059
Use more robust approach to keep track of the parent context
pquentin 3caee68
Fix lint
pquentin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
On a first look it seemed to me the
otel_span
attribute would be optional, to handle the case of apps not using otel. But I guess when otel is disabled this is just a fake span object that doesn't do anything?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.
Yes, exactly, see https://github.com/elastic/elasticsearch-py/pull/2616/files#diff-78ec49b32fc64dc78b569e87b525b22c8d412e606e476c4861d8b108a9289e04R93. Having a fake object avoids using ifs, allowing None, etc.