WebService::DataDog::Event - Interface to Event functions in DataDog's API.
This module allows you interact with the Event endpoint of the DataDog API.
Per DataDog: "The events service allows you to programatically post events to the stream and fetch events from the stream."
Search the event stream using specified parameters.
my $event = $datadog->build('Event'); my $event_list = $event->search( start => $start_time, end => $end_time, # Optional - default 'now' priority => $priority, # Optional - low|normal sources => $sources, # Optional - list of sources. Ex: Datadog, Github, Pingdom, Webmetrics tags => $tag_list, # Optional - list of tags associated with the event ); Examples: + Find all events in the last 48 hours. my $event_list = $event->search( start => time() - ( 48 * 60 * 60 ), ); + Find all events in the last 24 hours tagged with 'env:prod'. my $event_list = $event->search( start => time() - ( 24 * 60 * 60 ), end => time(), tags => [ 'env:prod' ], );
The start of the date/time range to be searched. UNIX/Epoch/POSIX time.
Optional. The end of the date/time range to be searched. UNIX/Epoch/POSIX time. Default = now.
Optional. Event priority level. Accepted values: low, normal.
Optional. List of sources that generated events.
Optional. List of tags associated with the events.
Deprecated. Please use retrieve() instead.
Get details of specified event. NOTE: Receiving a 404 response likely means the requested event id does not exist.
my $event = $datadog->build('Event'); my $event_data = $event->retrieve( id => $event_id );
Deprecated. Please use create() instead.
Post event to DataDog event stream. This will overlay red areas on all dashboards, corresponding to each event. Example uses: code pushes, server/service restarts, etc.
Per DataDog: "This end point allows you to post events to the stream. You can tag them, set priority and event aggregate them with other events."
my $event = $datadog->build('Event'); $event->create( title => $event_title, text => $event_text, # Body/Description of the event. date_happened => $timestamp, # Optional, default "now" priority => $priority, # Optional. normal|low related_event_id => $event_id, # Optional, id of aggregate event tags => $tag_list, # Optional - tags to apply to event (easy to search by) alert_type => $alert_type, # Optional. error|warning|info|success aggregation_key => $agg_key, # Optional. Arbitrary string to use for aggregation. source_type_name => $source_type, # Optional. nagios|hudson|jenkins|user|my apps|feed|chef|puppet|git|bitbucket|fabric|capistrano ); Examples: + Submit a user event, with timestamp of `now`. $event->create( title => 'Test event', text => 'Testing posting to event stream', source_type_name => 'user', );
The event title.
Optional. Event body/description.
Optional. Default value 'now'. POSIX/Unix time.
Optional. Allowed values: normal, low.
Optional. The id of the aggregate event.
Optional. List of tags associated with the event.
Optional. "error", "warning", "info" or "success"
Optional. An arbitrary string to use for aggregation.
Optional. The type of event being posted. Allowed values: nagios, hudson, jenkins, user, my apps, feed, chef, puppet, git, bitbucket, fabric, capistrano
Error checking for search()
Error checking for create()
<jpinkham at cpan.org>.
Please report any bugs or feature requests to
bug-WebService-DataDog at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-DataDog. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Copyright 2013 Jennifer Pinkham.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License.
See http://dev.perl.org/licenses/ for more information.