How to have a single trace_id
for child Sidekiq jobs
#1689
Replies: 1 comment
-
using this: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I am trying to have a relation between parent and child Sidekiq Jobs. e.g:
jobOne
createsjobTwo
createsjobThree
etc.Currently each job receives its own
trace_id
, and atraceparent
with the parent job trace.To be able to easily track the subsequent jobs I want them all to have the same
trace_id
.( I am logging the
trace_id
for every log and if all would have the same trace_id it would make our life much easier tracking the flow of the request through the various jobs)I tried reading the traceparent and setting it as a current
trace_id
for the child job but couldn't.After more trial and error I tried creating a child span with this sidekiq middleware (below)
Im still getting errors and generally not sure I'm doing the right thing here..
Maybe I should just change the Sidke otel configuration or something like this?
Can anyone please assist?
My project setup:
ruby '2.6.8'
'rails', '5.2.6'
gem 'opentelemetry-sdk', '1.2' # installing version 1.2 to avoid bug on higher versions that was fixed only on ruby 3.0 ->#1495
gem 'opentelemetry-exporter-otlp'
gem 'opentelemetry-instrumentation-all', '0.30.0' # installing version 0.30.0 since higher version internally depend on Rails 6 --> #1050 (comment)
than simply calling:
Thanks a lot in advance for any help!!
Beta Was this translation helpful? Give feedback.
All reactions