Class: BrainzLab::Instrumentation::SidekiqInstrumentation::ClientMiddleware
- Inherits:
-
Object
- Object
- BrainzLab::Instrumentation::SidekiqInstrumentation::ClientMiddleware
- Defined in:
- lib/brainzlab/instrumentation/sidekiq.rb
Overview
Client middleware - runs when jobs are enqueued
Instance Method Summary collapse
Instance Method Details
#call(_worker_class, job, queue, _redis_pool) ⇒ Object
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/brainzlab/instrumentation/sidekiq.rb', line 204 def call(_worker_class, job, queue, _redis_pool) # Inject trace context for distributed tracing inject_trace_context(job) # Add breadcrumb for job enqueue if BrainzLab.configuration.reflex_enabled BrainzLab::Reflex.( "Enqueue #{job['class']}", category: 'job.sidekiq.enqueue', level: :info, data: { queue: queue, job_id: job['jid'] } ) end # Record span for Pulse record_enqueue_span(job, queue) yield end |