Module: Datadog::Tracing::Contrib::ActiveJob::Events::EnqueueAt
- Defined in:
- lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb
Overview
Defines instrumentation for enqueue_at.active_job event
Constant Summary collapse
- EVENT_NAME =
'enqueue_at.active_job'
Class Method Summary collapse
Methods included from Datadog::Tracing::Contrib::ActiveJob::Event
Class Method Details
.event_name ⇒ Object
21 22 23 |
# File 'lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb', line 21 def event_name self::EVENT_NAME end |
.on_start(span, event, _id, payload) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb', line 29 def on_start(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_AT) # Set analytics sample rate if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) end (span, payload) rescue StandardError => e Datadog.logger.debug(e.) end |
.span_name ⇒ Object
25 26 27 |
# File 'lib/datadog/tracing/contrib/active_job/events/enqueue_at.rb', line 25 def span_name Ext::SPAN_ENQUEUE end |