#1036965 ITP: libplack-middleware-prometheus-requesttimes-perl -- Perl module that records response times with a prometheus histogram

#1036965#5
Date:
2023-05-31 03:08:28 UTC
From:
To:
* Package name    : libplack-middleware-prometheus-requesttimes-perl
  Version         : 0.0001
  Upstream Author : Colin Newell <colin@opusvl.com>
* URL             : https://metacpan.org/release/Plack-Middleware-Prometheus-RequestTimes
* License         : Artistic or GPL-1+
  Programming Lang: Perl
  Description     : Perl module that records response times with a prometheus histogram

To setup a prometheus metrics app in your PSGI application, hook this
Plack::Middleware::Prometheus::RequestTimes middleware up with a histogram and
the metrics can report on your response times.

use strict;

use warnings;

use My::Website;

use Net::Prometheus;

use Net::Prometheus::ProcessCollector;

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

$client->register( Net::Prometheus::ProcessCollector->new(

prefix => "parent_process",

pid => getppid(),

) );

my $response_times = $client->new_histogram(

name => "response_times",

help => "Application response times",

);