WebService::DataDog::Metric - Interface to Metric functions in DataDog's API.
Version 0.7.0
Deprecated. Please use emit() instead.
Post single/multiple time-series metrics. NOTE: only metrics of type 'gauge' and type 'counter' are supported. You must use a dogstatsd client such as Net::Dogstatsd to post metrics of other types (ex: 'timer', 'histogram', 'sets' or use increment() or decrement() on a counter). The primary advantage of the API vs dogstatsd for posting metrics: API allows posting metrics from the past.
Per DataDog: "The metrics end-point allows you to post metrics data so it can be graphed on Datadog's dashboards."
my $metric = $datadog->build('Metric'); $metric->emit( name => $metric_name, type => $metric_type, # Optional - gauge|counter. Default=gauge. value => $metric_value, # For posting a single data point, time 'now' data_points => $data_points, # 1+ data points, with timestamps host => $hostname, # Optional - host that produced the metric tags => $tag_list, # Optional - tags associated with the metric ); Examples: + Submit a single point with a timestamp of `now`. $metric->emit( name => 'page_views', value => 1000, ); + Submit a point with a timestamp. $metric->emit( name => 'my.pair', data_points => [ [ 1317652676, 15 ] ], ); + Submit multiple points. $metric->emit( name => 'my.series', data_points => [ [ 1317652676, 15 ], [ 1317652800, 16 ], ] ); + Submit a point with a host and tags. $metric->emit( name => 'my.series', value => 100, host => "myhost.example.com", tags => [ "version:1" ], );
Parameters:
name
The metric name.
type
Optional. Metric type. Allowed values: gauge, counter. Default = gauge.
value
Metric value. Used when you only need to post a single data point, with timestamp 'now'. Use 'data_points' to post a single metric with a timestamp.
data_points
Array of arrays of timestamp and metric value.
host
Optional. Host that generated the metric.
tags
Optional. List of tags associated with the metric.
$self->_error_checks( %args );
Common error checking for all metric types.
Jennifer Pinkham, <jpinkham at cpan.org>.
<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.
bug-WebService-DataDog at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WebService::DataDog::Metric
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WebService-DataDog
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WebService-DataDog
CPAN Ratings
http://cpanratings.perl.org/d/WebService-DataDog
Search CPAN
http://search.cpan.org/dist/WebService-DataDog/
Thanks to ThinkGeek (http://www.thinkgeek.com/) and its corporate overlords at Geeknet (http://www.geek.net/), for footing the bill while I write code for them!
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.
To install WebService::DataDog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::DataDog
CPAN shell
perl -MCPAN -e shell install WebService::DataDog
For more information on module installation, please visit the detailed CPAN module installation guide.