Sha256: aff5fa8d26564418c0ba8338b2ab3f3ae7626f69ab6ed58efd242dc9c754c35d
Contents?: true
Size: 654 Bytes
Versions: 3
Compression:
Stored size: 654 Bytes
Contents
# frozen_string_literal: true require "opentracing" module Labkit module Tracing module Sidekiq # ServerMiddleware provides a sidekiq server middleware for # instrumenting distributed tracing calls when they are # executed by the Sidekiq server class ServerMiddleware include SidekiqCommon SPAN_KIND = "server" def call(_worker, job, _queue) context = tracer.extract(OpenTracing::FORMAT_TEXT_MAP, job) in_tracing_span(operation_name: "sidekiq:#{job["class"]}", child_of: context, tags: tags_from_job(job, SPAN_KIND)) { |_span| yield } end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems