Distributed traces on background jobs

Hi, a question prodding feasability of getting distributed traces on asynchronous jobs. In my (Rails) application, web requests kick off background jobs that are processed in Sidekiq. I see the Sidekiq transaction and the request transaction separately in Kibana APM. I'd like to see them as a distributed trace, even though I know that the web transaction might end before the asynchronous job begins.

Does this make sense as a thing to do? Because and if so, might I be right in thinking that the Traceparent and TraceState need to somehow be passed over to the background job, and set on the transaction there?

1 Like

Your idea makes a lot of sense! This is actually something we're currently investigating. No work yet on the agent but it's something we want to do.

Can't give you any dates or timelines though, sorry.

Thanks for the confirmation. Could you give some high level pointers on what it might mean to get it implemented?

For the agent work, I imagine would be more generalized, but if we have a specific setup, say with rails and sidekiq, would passing additional parameters to the job(in particular traceparent and tracestate) work? Any thoughts on how one might serialize info like that to be passed over to sidekiq? Am I missing any other info that I need to pass?

We have a discussion in a GitHub issue, if you'd like to follow it. Unfortunately, as Mikkel said, we don't have a timeline for it yet.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.