Class: ExceptionNotifier::DatadogNotifier
- Inherits:
-
BaseNotifier
- Object
- BaseNotifier
- ExceptionNotifier::DatadogNotifier
- Defined in:
- lib/exception_notifier/datadog_notifier.rb
Defined Under Namespace
Classes: DatadogExceptionEvent
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#default_options ⇒ Object
readonly
Returns the value of attribute default_options.
Attributes inherited from BaseNotifier
Instance Method Summary collapse
- #call(exception, options = {}) ⇒ Object
- #datadog_event(exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ DatadogNotifier
constructor
A new instance of DatadogNotifier.
Methods inherited from BaseNotifier
#_post_callback, #_pre_callback, #send_notice
Constructor Details
#initialize(options) ⇒ DatadogNotifier
Returns a new instance of DatadogNotifier.
10 11 12 13 14 |
# File 'lib/exception_notifier/datadog_notifier.rb', line 10 def initialize() super @client = .fetch(:client) @default_options = end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/exception_notifier/datadog_notifier.rb', line 7 def client @client end |
#default_options ⇒ Object (readonly)
Returns the value of attribute default_options.
7 8 9 |
# File 'lib/exception_notifier/datadog_notifier.rb', line 7 def @default_options end |
Instance Method Details
#call(exception, options = {}) ⇒ Object
16 17 18 19 20 |
# File 'lib/exception_notifier/datadog_notifier.rb', line 16 def call(exception, = {}) client.emit_event( datadog_event(exception, ) ) end |
#datadog_event(exception, options = {}) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/exception_notifier/datadog_notifier.rb', line 22 def datadog_event(exception, = {}) DatadogExceptionEvent.new( exception, .reverse_merge() ).event end |