Jennifer Pinkham > WebService-DataDog > WebService::DataDog::Metric

Download:
WebService-DataDog-1.0.0.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: v1.0.0   Source  

NAME ^

WebService::DataDog::Metric - Interface to Metric functions in DataDog's API.

VERSION ^

Version 1.0.0

METHODS ^

post_metric()

Deprecated. Please use emit() instead.

emit()

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:

INTERNAL FUNCTIONS ^

_error_checks()

        $self->_error_checks( %args );

Common error checking for all metric types.

AUTHOR ^

Jennifer Pinkham, <jpinkham at cpan.org>.

BUGS ^

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.

SUPPORT ^

You can find documentation for this module with the perldoc command.

        perldoc WebService::DataDog::Metric

You can also look for information at:

ACKNOWLEDGEMENTS ^

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 & LICENSE ^

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.

syntax highlighting: