lib/ddtrace/contrib/sidekiq/server_tracer.rb in ddtrace-0.45.0 vs lib/ddtrace/contrib/sidekiq/server_tracer.rb in ddtrace-0.46.0

- old
+ new

@@ -20,11 +20,10 @@ service = worker_config(resource, :service_name) || @sidekiq_service tag_args = worker_config(resource, :tag_args) || configuration[:tag_args] @tracer.trace(Ext::SPAN_JOB, service: service, span_type: Datadog::Ext::AppTypes::WORKER, on_error: @error_handler) do |span| - span.resource = resource # Set analytics sample rate if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) end @@ -36,13 +35,11 @@ span.set_tag(Ext::TAG_JOB_RETRY, job['retry']) span.set_tag(Ext::TAG_JOB_RETRY_COUNT, job['retry_count']) span.set_tag(Ext::TAG_JOB_QUEUE, job['queue']) span.set_tag(Ext::TAG_JOB_WRAPPER, job['class']) if job['wrapped'] span.set_tag(Ext::TAG_JOB_DELAY, 1000.0 * (Time.now.utc.to_f - job['enqueued_at'].to_f)) - if tag_args && !job['args'].nil? && !job['args'].empty? - span.set_tag(Ext::TAG_JOB_ARGS, job['args']) - end + span.set_tag(Ext::TAG_JOB_ARGS, job['args']) if tag_args && !job['args'].nil? && !job['args'].empty? yield end end @@ -58,12 +55,10 @@ Object.const_get(resource) rescue NameError nil end - if worker_klass.respond_to?(:datadog_tracer_config) - worker_klass.datadog_tracer_config[key] - end + worker_klass.datadog_tracer_config[key] if worker_klass.respond_to?(:datadog_tracer_config) end end end end end