Adding a tag to identify OkHttp calls made from OTel exporters #5906
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.
Related to #5886
After deciding to use an internal solution in the previous SIG, and also raising concerns about the usage of a Context key due to performance penalties, I believe this approach is the most straightforward and stable way to identify OTel's OkHttp calls for internal, automatic instrumentation purposes, since it doesn't need to use Context keys, nor does it need to rely on Thread's values propagation or intercepting threads that OkHttp will use for async calls (in case of using ThreadLocals) or relying on the thread's name, since it seems like it's being changed before running OkHttp's interceptors, which is where the automatic traces are created.