-
Notifications
You must be signed in to change notification settings - Fork 226
fix: Fixing missing OpenTelemetry::Context detach on Excon instrumentation #1725
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
arielvalentin
merged 8 commits into
open-telemetry:main
from
pafuent:instrumentation_excon_fixing_missing_context_detach_when_span_is_not_recorded
Oct 10, 2025
Merged
fix: Fixing missing OpenTelemetry::Context detach on Excon instrumentation #1725
arielvalentin
merged 8 commits into
open-telemetry:main
from
pafuent:instrumentation_excon_fixing_missing_context_detach_when_span_is_not_recorded
Oct 10, 2025
Conversation
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
…ation When a span is not recorded, for example when you are sampling traces, the OpenTelemetry::Context attached on `request_call` is never detached. This happens because `handle_response` is doing nothing if `span.recording?` is false. Here is example of the error that the missing detach generated: ``` ERROR -- : OpenTelemetry error: calls to detach should match corresponding calls to attach. ```
05107f0 to
b4b77d0
Compare
…_detach_when_span_is_not_recorded
...mentation/excon/lib/opentelemetry/instrumentation/excon/middlewares/dup/tracer_middleware.rb
Outdated
Show resolved
Hide resolved
…_detach_when_span_is_not_recorded
c583ed1 to
053afce
Compare
…_detach_when_span_is_not_recorded
arielvalentin
approved these changes
Oct 9, 2025
Contributor
arielvalentin
left a comment
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.
Thank you for this submission and fix!
kaylareopelle
approved these changes
Oct 9, 2025
Contributor
kaylareopelle
left a comment
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.
Thank you! I really appreciate you adding the fix to all three conventions versions too! 🏆
…_detach_when_span_is_not_recorded
…_detach_when_span_is_not_recorded
americodls
pushed a commit
to intercom/opentelemetry-ruby-contrib
that referenced
this pull request
Oct 12, 2025
…ation (open-telemetry#1725) * fix: Fixing missing OpenTelemetry::Context detach on Excon instrumentation When a span is not recorded, for example when you are sampling traces, the OpenTelemetry::Context attached on `request_call` is never detached. This happens because `handle_response` is doing nothing if `span.recording?` is false. Here is example of the error that the missing detach generated: ``` ERROR -- : OpenTelemetry error: calls to detach should match corresponding calls to attach. ``` * Fixing tests following action_pack strategy to change the sampler * Improving datum handling --------- Co-authored-by: Kayla Reopelle <[email protected]>
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.
When a span is not recorded, for example when you are sampling traces, the OpenTelemetry::Context attached on
request_callis never detached. This happens becausehandle_responseis doing nothing ifspan.recording?is false.Here is example of the error that the missing detach generated: