Exposes metrics:
with labels of action and controller to help identify popular endpoints and their performance characteristics.
QOV7KWRH2W7X2SC23A7FPXHUQHAAVAQ22TC4C3MBPDACZT73DAOQC
2SP37OH2M7X45QUU7L4HRF6Q4JO7AWBDCYDLA5BCXCKD4L4QQQXQC
2G37UFZFPDTQOZGD2PFIL3D4FT53G4FJNSD43Y6MSZPBABLFD3IQC
MQLCUSZLZWVUI6OE4TVYRJWEGBF3GF4MWWSZGF4WLC35TIOKE3IAC
RWNXH3H26EQHKJNMP4DUJCJKUYQBMV347234ZLE26SIFTVLSUWXQC
XJRJ4J7M6BC433TBLWHHKX7UYYCFX6M7ZQLUEYYTREPCSM6M3RDQC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
S66BOMVUACAUDSGSDWP7ZIXVMZSQHWXOZYVTB7ILUCWZ7DDFAKVAC
U2ZK6LZ7MTUISO6AXHAWGSQLWRJYAWMYZPN4MORRGUT6POM6X7HQC
license = with final.lib.licenses; [ artistic1 gpl1Plus ];
};
};
CatalystPluginPrometheusTiny = final.buildPerlPackage {
pname = "Catalyst-Plugin-PrometheusTiny";
version = "0.005";
src = final.fetchurl {
url = "mirror://cpan/authors/id/S/SY/SYSPETE/Catalyst-Plugin-PrometheusTiny-0.005.tar.gz";
sha256 = "a42ef09efdc3053899ae007c41220d3ed7207582cc86e491b4f534539c992c5a";
};
buildInputs = with final.perlPackages; [ HTTPMessage Plack SubOverride TestDeep ];
propagatedBuildInputs = with final.perlPackages; [ CatalystRuntime Moose PrometheusTiny PrometheusTinyShared ];
meta = {
description = "Prometheus metrics for Catalyst";
use feature 'unicode_strings';
use strict;
use Setup;
use JSON qw(decode_json encode_json);
my %ctx = test_init();
require Hydra::Schema;
require Hydra::Model::DB;
require Hydra::Helper::Nix;
use HTTP::Request::Common;
use Test2::V0;
require Catalyst::Test;
Catalyst::Test->import('Hydra');
my $db = Hydra::Model::DB->new;
hydra_setup($db);
request(GET '/');
my $metrics = request(GET '/metrics');
ok($metrics->is_success);
like(
$metrics->content,
qr/http_requests_total\{action="index",code="200",controller="Hydra::Controller::Root",method="GET"\} 1/,
"Metrics are collected"
);
done_testing;