-
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 integration can't be combined with other integrations #535
Comments
Thanks for creating the repo to help recreate this issue! I do not have much experience using Sidekiq and I was wondering if you see this problem when running the sample application and export the spans to local collector. Do you see the spans then? Here is an example to get you started: If you see all of the instrumentation spans being exported to the collector and then available in a backend like zipkin then it narrows down the problem to an issue with the console exporter. If not then I think we have to dig in to figure out what's missing or not working when your demo app registers in the individual instrumentations. |
Thanks for the quick reply! I was in fact working with a local Grafana Tempo instance when I noticed the missing spans. I just used the console exporter to simplify the explanation. For good measure, I just tested with zipkin. I still see the same behavior: all spans dissapear except for the Sidekiq one. See screenshots attached. Only Both I also noticed some warnings in the terminal running
|
Thanks for giving it a shot and reporting the results. Looking at the example it occurred to me we actually did not have any automated tests against sidekiq 7 and I believe there are some incompatibilities in our latest instrumentation that needed to be fixed: #527 (comment) I am surprised that you are getting any spans at all right now. Would you mind downgrading to sidekiq 6 and confirm that it works? |
Just tested with both I'm now working on a test outside of rails just to see if that's related. |
No luck. Exact same behavior. |
@plantfansam are y'all using sidekiq at Shopify? Are y'all experiencing this behavior? |
One more request for you @kevinnio. If you use the |
@chrisholmes shared some his experience working with this instrumentation:
I will have to look into those options to see what they do but it looks like the default configuration may be following the messaging specification and creating new root spans, however the fact that you are getting warnings saying the @kevinnio would you be interested in continuing to dig into this issue and potentially submitting a PR for a fix? |
We are using Sidekiq ( I'm going to upgrade our Sidekiq (we also run Sidekiq Enterprise/Pro, though I'm not sure that's got anything to do with it) to the latest and see if we're still working. UPDATE. I upgraded to the latest Sidekiq releases ( |
@stevenharman Thanks for the input. Just tested with @arielvalentin Sure. I'll give it a try. |
Found the issue. The issue starts here: Root causeLine 21 in cc244b9
When
This results in nothing inside the job being traced. That's why those child spans are missing. FixesNow, one fix is setting So, another possible fix would be to change the code and replace the patch for def process_one
if instrumentation_config[:trace_processor_process_one]
attributes = {}
attributes[SemanticConventions::Trace::PEER_SERVICE] = instrumentation_config[:peer_service] if instrumentation_config[:peer_service]
tracer.in_span('Sidekiq::Processor#process_one', attributes: attributes) { super }
else
- OpenTelemetry::Common::Utilities.untraced { super }
+ super
end
end This way everyone can have full job traces and if they wish to enable What do you think of my suggestion? Should I submit a PR right away? |
Thanks for tracking that down. I don't know enough about this instrumentation to know why it's implemented this way and why that's the default. I'll take a look at the git history and conversations in the PR to see if I am able to understand how we got here. |
Forgot to mention that line is also related to those There's a check for an Looks like at this point the code is expecting no current span to exist so it will return |
This is biting us in a different way (#544), but it all seems to come down to the untraced May I suggest to kill 2 birds with one stone by removing that span completely?
|
Thank you all for taking the time to investigate these issues and propose solutions. I don't have any good feedback for y'all since I am not a Sidekiq user but given that you both have invested time in tracking down the issues I want to encourage you all to open PRs that changes the functionality to conform to messaging OTEPs. If y'all could add appraisals for Sidekiq 7, that would also be greatly appreciated. I will prioritize reviewing the changes as soon as they are in. Thank you! |
Thanks, @arielvalentin. @monoviolento so we're going with completely removing the |
Thank you @kevinnio ! |
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.
Thank you! If it's not too much trouble could you add a screen shot of the instrumentation in action without process_one to the PR? |
Screenshots added. |
👋 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 new to
opentelemetry-ruby
so I may be missing something. I tried to make this work for a while, I looked around in the repo's issues, everything to no avail so now I'm asking here.Whenever I include the
sidekiq
instrumentation in myconfigure
block inside my rails app spans from other instrumentations are no longer generated, or at least not visible in the console anymore.Let's ilustrate the issue by starting with only
PG
:OTEL_TRACES_EXPORTER
is set toconsole
.Let's say I boot up sidekiq. As expected, I can see a bunch of PG traces in the console.
Now, let's add the
Sidekiq
:Restart
sidekiq
and run the same job again. Now, only one single Sidekiq trace is visible in the console. The PG ones are missing. I expected to see one parent Sidekiq span and a bunch of PG child ones.I tried with multiple instrumentations, not only
PG
. So far, this always happens.I created an example app so you can replicate the issue: https://github.com/kevinnio/opentel-test. Please let me know if you need additional info.
bundle info
:The text was updated successfully, but these errors were encountered: