Skip to content

Instantly share code, notes, and snippets.

@alq666
Created June 8, 2012 22:04
Show Gist options
  • Save alq666/2898296 to your computer and use it in GitHub Desktop.
Save alq666/2898296 to your computer and use it in GitHub Desktop.
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