Class: Labkit::Tracing::Sidekiq::ClientMiddleware
- Inherits:
-
Object
- Object
- Labkit::Tracing::Sidekiq::ClientMiddleware
- Includes:
- SidekiqCommon
- Defined in:
- lib/labkit/tracing/sidekiq/client_middleware.rb
Overview
ClientMiddleware provides a sidekiq client middleware for instrumenting distributed tracing calls made from the client application
Constant Summary collapse
- SPAN_KIND =
"client"
Instance Method Summary collapse
Methods included from SidekiqCommon
Methods included from Common
#in_tracing_span, #kv_tags_for_exception, #log_exception_on_span, #postnotify_span, #tracer
Instance Method Details
#call(_worker_class, job, _queue, _redis_pool) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/labkit/tracing/sidekiq/client_middleware.rb', line 16 def call(_worker_class, job, _queue, _redis_pool) in_tracing_span(operation_name: "sidekiq:#{job["class"]}", tags: (job, SPAN_KIND)) do |span| # Inject the details directly into the job tracer .inject(span.context, OpenTracing::FORMAT_TEXT_MAP, job) yield end end |