Module: Datadog::Tracing::Contrib::ActiveJob::Events::EnqueueRetry
- Defined in:
- lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb
Overview
Defines instrumentation for enqueue_retry.active_job event
Constant Summary collapse
- EVENT_NAME =
'enqueue_retry.active_job'.freeze
Class Method Summary collapse
Methods included from Datadog::Tracing::Contrib::ActiveJob::Event
Class Method Details
.event_name ⇒ Object
19 20 21 |
# File 'lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb', line 19 def event_name self::EVENT_NAME end |
.process(span, event, _id, payload) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb', line 27 def process(span, event, _id, payload) span.name = span_name span.service = configuration[:service_name] if configuration[:service_name] span.resource = payload[:job].class.name span.set_tag(Tracing::Metadata::Ext::TAG_OPERATION, Ext::TAG_OPERATION_ENQUEUE_RETRY) # Set analytics sample rate if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) end (span, payload) span.set_tag(Ext::TAG_JOB_ERROR, payload[:error]) span.set_tag(Ext::TAG_JOB_RETRY_WAIT, payload[:wait]) rescue StandardError => e Datadog.logger.debug(e.) end |
.span_name ⇒ Object
23 24 25 |
# File 'lib/datadog/tracing/contrib/active_job/events/enqueue_retry.rb', line 23 def span_name Ext::SPAN_ENQUEUE_RETRY end |