Created
June 8, 2012 22:04
-
-
Save alq666/2898296 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'dogapi' | |
datadog_api_key = "Find it at https://app.datadoghq.com/account/settings#api" | |
project_name = "Test" | |
msg = "Example of Aggregation of custom events (Support)" | |
host = "app.datadoghq.com" | |
dog = Dogapi::Client.new(datadog_api_key) | |
# First send an error | |
dog.emit_event(Dogapi::Event.new("By using the :aggregation_key option", | |
:msg_title => msg, | |
:aggregation_key => project_name, | |
:alert_type => "error" | |
), :host => host) | |
# Then send a success | |
dog.emit_event(Dogapi::Event.new("By using the :aggregation_key option", | |
:msg_title => msg, | |
:aggregation_key => project_name, | |
:alert_type => "success" | |
), :host => host) | |
# Both events are aggregated and the aggregate is shown in green | |
# since it denotes the status of the last event in the aggregate. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment