Net::Prometheus::Counter(3pm)

Net::Prometheus::Counter3pm

A monotonically-increasing counter metric

Usage

   use Net::Prometheus;
   my $client = Net::Prometheus->new;
   my $counter = $client->new_counter(
      name => "requests",
      help => "Number of received requests",
   );
   sub handle_request
   {
      $counter->inc;
      ...
   }

Overview

This class provides a counter metric - a value that monotonically increases, usually used to represent occurrences of some event that happens within the instrumented program. It is a subclass of Net::Prometheus::Metric.

Constructor

Instances of this class are not usually constructed directly, but instead via the Net::Prometheus object that will serve it:

   $counter = $prometheus->new_counter( %args );

This takes the same constructor arguments as documented in Net::Prometheus::Metric.

Methods

inc

   $counter->inc( @label_values, $delta );
   $counter->inc( \%labels, $delta );
   $child->inc( $delta );

Increment the current value for the gauge. $delta will default to 1 if not supplied and must be non-negative.

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Author

Paul Evans <[email protected]>

From libnet-prometheus-perl 0.14-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.