You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classPostsController < ApplicationControllerdefcreate# How do I pass the trace_id to the worker?PostsWorker.perform_async(post_id,trace_id)endendclassPostsWorkerincludeSidekiq::Workerdefperform(post_id,trace_id)# How do I set the trace_id in the worker?Sentry.set_trace_id(trace_id)endend
It currently starts a separate trace for the controller and the worker, but I'd like the worker to belong to the same trace as the request. Is there a way to do this?
The text was updated successfully, but these errors were encountered:
@choxi currently it's not possible without adding your own Sidekiq client middleware. but I think this is something we should support natively. so I'll implement it in a future release 🙂
One related question: if our frontend is sending sentry-trace headers, will the backend always capture those even if it goes over the sample rate? Is there a way to make sure we always capture the full trace when the sample rate is < 1?
@choxi if you use traces_sample_rate, the inherited sampling decision will be prioritized over it.
if you use traces_sampler, you need to prioritize it yourself.
config.traces_sampler=lambdado |sampling_context|
parent_sampled=sampling_context[:parent_sampled]if !parent_sampled.nil?parent_sampledelse# the rest of sampling logicendend
What is the recommended way to pass a trace ID from Rails to a Sidekiq worker? I have this configuration:
and
When I queue a Sidekiq job:
It currently starts a separate trace for the controller and the worker, but I'd like the worker to belong to the same trace as the request. Is there a way to do this?
The text was updated successfully, but these errors were encountered: