Class: Backups::Listeners::Notify::Datadog

Inherits:
Backups::Listener show all
Defined in:
lib/backups/listeners/notify/datadog.rb

Instance Method Summary collapse

Methods inherited from Backups::Listener

listen

Constructor Details

#initialize(config) ⇒ Datadog

Returns a new instance of Datadog.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/backups/listeners/notify/datadog.rb', line 8

def initialize config
  @config = config
  api_key = @config.fetch("api_key")
  app_key = @config.fetch("app_key")

  @dog = Dogapi::Client.new(api_key, app_key)

  $LOGGER.debug "Datadog listener started"
  Events::on :start, :done, :error do |params|
    _notify params
  end
end