-
Notifications
You must be signed in to change notification settings - Fork 181
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
Sidekiq instrumentation not creating child spans with SDK 1.2.1 #544
Comments
According to the discussion in open-telemetry#535, we can better match spec by avoiding the `sidekiq::processor#process_one` span altogether. This fixes the issues described in open-telemetry#535 and open-telemetry#544.
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
Upgrading to |
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
Hi! I'm using the Sidekiq instrumentation with the option
propagation_style: :child
. This works fine withopentelemetry-sdk
1.2.0 but fails when upgrading to 1.2.1."Fails" here means that spans are not exported, tested with a minimal example using the
console
exporter.Tracking down the problem, I think it all comes down to the same root cause of #535
opentelemetry-sdk
1.2.1 introduced this check inOpenTelemetry::SDK::Trace::Tracer#start_span
(MR here):https://github.com/open-telemetry/opentelemetry-ruby/blob/1159ec04aa62168c6a841273401b71c325fa5986/sdk/lib/opentelemetry/sdk/trace/tracer.rb#L32
trace_processor_process_one: true
, the context is set asuntraced
:opentelemetry-ruby-contrib/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/patches/processor.rb
Line 16 in cc244b9
process
span is going to be created,extracted_context
isuntraced
. (Please note that for the defaultpropagation_style: :link
a new root span with its own context is created, and that works)opentelemetry-ruby-contrib/instrumentation/sidekiq/lib/opentelemetry/instrumentation/sidekiq/middlewares/server/tracer_middleware.rb
Line 33 in cc244b9
tracer.in_span
is used, which ends up calling the SDKstart_span
from point 1, which follow theuntraced
branch and, long story short, ends up creating aOpenTelemetry::Trace::Span
instead of anOpenTelemetry::SDK::Trace::Span
OpenTelemetry::Trace::Span
does nothing onfinish
, and spans are silently dropped:https://github.com/open-telemetry/opentelemetry-ruby/blob/1159ec04aa62168c6a841273401b71c325fa5986/api/lib/opentelemetry/trace/span.rb#L154
(Edit: Not sure why some links are showing as snippets and others as huge links, sorry about that)
The text was updated successfully, but these errors were encountered: