File: parent-process.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 (19 lines) | stat: -rwxr-xr-x 342 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;

use Net::Prometheus;
use Net::Prometheus::ProcessCollector;

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

$client->register( Net::Prometheus::ProcessCollector->new(
   prefix => "parent_process",
   pid => getppid(),
) );

use Plack::Builder;

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