Sha256: 696fe370dda9f3fd95ef30910a1bab8f6b92332026438ffb91626656eccf3fd6

Contents?: true

Size: 1.64 KB

Versions: 26

Compression:

Stored size: 1.64 KB

Contents

require 'rubygems'
require 'dogapi'

# Create a simple client
# The host is optional here, it's a shortcut to tie event and metrics to a given host
#
# You typically want to do:
#   Dogapi::Client.new(your_actual_api_key_as_a_string, ...)
# We are using ENV to let you experiment via an environment variable.
dog = Dogapi::Client.new(ENV['DATADOG_KEY'])

# Let's use tags and aggregation
# We will send 2 related events, one error and one success.

dog.emit_event(Dogapi::Event.new("Uh-oh, something bad happened",
                                 :msg_title       => "Alert! Alert!",
                                 :aggregation_key => "job-123",
                                 :alert_type      => "error",
                                 :tags            => ["ruby", "dogapi"]
                                 ))

dog.emit_event(Dogapi::Event.new("Now that's better",
                                 :msg_title       => "All systems green",
                                 :aggregation_key => "job-123",
                                 :alert_type      => "success",
                                 :tags            => ["ruby", "dogapi"]
                                 ))

# You should see something like this in your stream:
# screenshot: https://img.skitch.com/20120705-3s4icgxfc689x1jtrx1yr1m5k.png

# And if you graph a metric and want to overlay these events on the graphs
# You can use the following query: "tags:dogapi tags:ruby" in the graph editor
# screenshot: https://img.skitch.com/20120705-m4h6f4377cbm2d3rctnd6biej9.png

# Then you can see the events neatly overlaid on your graph
# screenshot: https://img.skitch.com/20120705-xybhimti31u4s4m42ac854568h.png

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
dogapi-1.30 examples/custom_event.rb
dogapi-1.29.0 examples/custom_event.rb
dogapi-1.28.0 examples/custom_event.rb
dogapi-1.27.0 examples/custom_event.rb
dogapi-1.26.0 examples/custom_event.rb
dogapi-1.25.0 examples/custom_event.rb
dogapi-1.24.0 examples/custom_event.rb
dogapi-1.23.0 examples/custom_event.rb
dogapi-demo-0.1.0 examples/custom_event.rb
dogapi-1.22.0 examples/custom_event.rb
dogapi-1.21.0 examples/custom_event.rb
dogapi-1.20.0 examples/custom_event.rb
dogapi-1.19.0 examples/custom_event.rb
dogapi-1.18.0 examples/custom_event.rb
dogapi-1.17.0 examples/custom_event.rb
dogapi-1.16.0 examples/custom_event.rb
dogapi-1.15.0 examples/custom_event.rb
dogapi-1.14.0 examples/custom_event.rb
dogapi-1.13.0 examples/custom_event.rb
dogapi-1.12.0 examples/custom_event.rb