Class: PagingDatadogClient
- Inherits:
-
Object
- Object
- PagingDatadogClient
- Defined in:
- lib/bosh/monitor/plugins/paging_datadog_client.rb
Instance Attribute Summary collapse
-
#datadog_recipient ⇒ Object
readonly
Returns the value of attribute datadog_recipient.
Instance Method Summary collapse
- #emit_event(event) ⇒ Object
- #emit_points(metric, points, options = {}) ⇒ Object
-
#initialize(datadog_recipient, datadog_client) ⇒ PagingDatadogClient
constructor
A new instance of PagingDatadogClient.
Constructor Details
#initialize(datadog_recipient, datadog_client) ⇒ PagingDatadogClient
Returns a new instance of PagingDatadogClient.
4 5 6 7 |
# File 'lib/bosh/monitor/plugins/paging_datadog_client.rb', line 4 def initialize(datadog_recipient, datadog_client) @datadog_recipient = datadog_recipient @datadog_client = datadog_client end |
Instance Attribute Details
#datadog_recipient ⇒ Object (readonly)
Returns the value of attribute datadog_recipient.
2 3 4 |
# File 'lib/bosh/monitor/plugins/paging_datadog_client.rb', line 2 def datadog_recipient @datadog_recipient end |
Instance Method Details
#emit_event(event) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bosh/monitor/plugins/paging_datadog_client.rb', line 13 def emit_event(event) event_hash = event.to_hash = if event.priority == "normal" "#{event.msg_text} @#{@datadog_recipient}" else event.msg_text end new_event = Dogapi::Event.new(, event_hash) @datadog_client.emit_event(new_event) end |
#emit_points(metric, points, options = {}) ⇒ Object
9 10 11 |
# File 'lib/bosh/monitor/plugins/paging_datadog_client.rb', line 9 def emit_points(metric, points, ={}) @datadog_client.emit_points(metric, points, ) end |