Class: Backup::Notifier::DataDog

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/notifier/datadog.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#max_retries, #message, #model, #on_failure, #on_success, #on_warning, #retry_waitsec

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Config::Helpers

included

Methods included from Utilities::Helpers

#utility_remote

Constructor Details

#initialize(model, &block) ⇒ DataDog

Returns a new instance of DataDog.



49
50
51
52
53
# File 'lib/backup/notifier/datadog.rb', line 49

def initialize(model, &block)
  super
  instance_eval(&block) if block_given?
  @title ||= "Backup #{ model.label }"
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers

Instance Attribute Details

#aggregation_keyObject

The aggregation_key for the event



43
44
45
# File 'lib/backup/notifier/datadog.rb', line 43

def aggregation_key
  @aggregation_key
end

#alert_typeObject

The alert_type of the event (error/warning/info/success)



39
40
41
# File 'lib/backup/notifier/datadog.rb', line 39

def alert_type
  @alert_type
end

#api_keyObject

The DataDog API key



10
11
12
# File 'lib/backup/notifier/datadog.rb', line 10

def api_key
  @api_key
end

#date_happenedObject

The timestamp for the event



23
24
25
# File 'lib/backup/notifier/datadog.rb', line 23

def date_happened
  @date_happened
end

#hostObject

The host that generated the event



31
32
33
# File 'lib/backup/notifier/datadog.rb', line 31

def host
  @host
end

#priorityObject

The priority of the event (low/normal)



27
28
29
# File 'lib/backup/notifier/datadog.rb', line 27

def priority
  @priority
end

#source_type_nameObject

The source_type for the event (nagios, hudson, jenkins, user, my apps, feed, chef, puppet, git, bitbucket, fabric, capistrano)



47
48
49
# File 'lib/backup/notifier/datadog.rb', line 47

def source_type_name
  @source_type_name
end

#tagsObject

The tags for this host (should be an array)



35
36
37
# File 'lib/backup/notifier/datadog.rb', line 35

def tags
  @tags
end

#titleObject

The title of the event



14
15
16
# File 'lib/backup/notifier/datadog.rb', line 14

def title
  @title
end