File: static.psgi

package info (click to toggle)
libnet-prometheus-perl 0.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 304 kB
  • sloc: perl: 1,847; makefile: 8
file content (18 lines) | stat: -rwxr-xr-x 268 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;

use Net::Prometheus;

my $client = Net::Prometheus->new;

$client->new_gauge(
   name => "ten",
   help => "The number ten",
)->set( 10 );

use Plack::Builder;

builder {
  mount "/metrics" => $client->psgi_app,
  sub { [ 500, [], [] ] }
};