Metrics::Any::Adapter::Prometheus - a metrics reporting adapter for Prometheus
Metrics::Any::Adapter::Prometheus
use Metrics::Any::Adapter 'Prometheus';
This Metrics::Any adapter type reports metrics to Prometheus by using Net::Prometheus. Each metric added to the adapter will be registered with the global Net::Prometheus::Registry instance.
It becomes the calling program's responsibility to arrange for these to be HTTP accessible by using the Net::Prometheus API.
Net::Prometheus
Distribution metrics are exported as Histograms by default. They may alternatively be exported as Summaries in order to generate smaller amounts of export data, by setting the use_histograms import argument to false:
use_histograms
use Metrics::Any::Adapter 'Prometheus', use_histograms => 0;
Timer metrics are implemented as distribution metrics with the units set to seconds.
seconds
This adapter type supports batch mdoe reporting. Callbacks are invoked at the beginning of the Net::Prometheus render method.
render
$adapter->make_distribution( $name, %args )
In addition to the standard arguments, the following are recognised:
If present, overrides the default Histogram bucket sizes.
Since version 0.04.
A more flexible alternative to specifying literal bucket sizes. The values given in buckets_per_decade are repeated, multiplied by various powers of 10 to generate values between bucket_min (or a default of 0.001 if not supplied) and bucket_max (or a default of 1000 if not supplied).
buckets_per_decade
bucket_min
bucket_max
For more information, see Net::Prometheus::Histogram.
Paul Evans <leonerd@leonerd.org.uk>
To install Metrics::Any::Adapter::Prometheus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Metrics::Any::Adapter::Prometheus
CPAN shell
perl -MCPAN -e shell install Metrics::Any::Adapter::Prometheus
For more information on module installation, please visit the detailed CPAN module installation guide.