module Datadog::Contrib::ActiveSupport::Notifications::Event::ClassMethods
Redefines some class behaviors for a Subscriber
to make it a bit simpler for an Event
.
Constants
- DEFAULT_TRACER
Public Instance Methods
payload_exception(payload)
click to toggle source
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 67 def payload_exception(payload) payload[:exception_object] || payload[:exception] # Fallback for ActiveSupport < 5.0 end
report_if_exception(span, payload)
click to toggle source
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 62 def report_if_exception(span, payload) exception = payload_exception(payload) span.set_error(payload[:exception]) if exception end
span_options()
click to toggle source
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 54 def span_options {} end
subscribe(pattern = nil, span_name = nil, options = nil, tracer = nil)
click to toggle source
Calls superclass method
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 38 def subscribe(pattern = nil, span_name = nil, options = nil, tracer = nil) if supported? super( pattern || event_name, span_name || self.span_name, options || span_options, tracer || self.tracer, &method(:process) ) end end
subscribe!()
click to toggle source
Publicly exposes protected method `subscribe!`
Calls superclass method
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 25 def subscribe! # rubocop:disable Lint/UselessMethodDefinition super end
subscription(span_name = nil, options = nil, tracer = nil)
click to toggle source
Calls superclass method
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 29 def subscription(span_name = nil, options = nil, tracer = nil) super( span_name || self.span_name, options || span_options, tracer || self.tracer, &method(:process) ) end
supported?()
click to toggle source
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 50 def supported? true end
tracer()
click to toggle source
# File lib/ddtrace/contrib/active_support/notifications/event.rb, line 58 def tracer DEFAULT_TRACER end