Sha256: 52b08dea82ae16bd3f1576ecc0a453784b257acc093c34120ea5da2e4da1a39f
Contents?: true
Size: 1.4 KB
Versions: 4
Compression:
Stored size: 1.4 KB
Contents
# typed: false require 'ddtrace/contrib/analytics' require 'ddtrace/contrib/active_support/notifications/event' require 'ddtrace/contrib/action_mailer/ext' module Datadog module Contrib module ActionMailer # Defines basic behaviors for an ActionMailer event. module Event def self.included(base) base.send(:include, ActiveSupport::Notifications::Event) base.send(:extend, ClassMethods) end # Class methods for ActionMailer events. module ClassMethods def span_options { service: configuration[:service_name] } end def tracer -> { configuration[:tracer] } end def configuration Datadog.configuration[:action_mailer] end def process(span, event, _id, payload) span.service = configuration[:service_name] span.resource = payload[:mailer] # Set analytics sample rate if Contrib::Analytics.enabled?(configuration[:analytics_enabled]) Contrib::Analytics.set_sample_rate(span, configuration[:analytics_sample_rate]) end # Measure service stats Contrib::Analytics.set_measured(span) report_if_exception(span, payload) rescue StandardError => e Datadog.logger.debug(e.message) end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems