Expose Prometheus metrics at /metrics

Exposes metrics:

* http_request_duration_seconds_bucket
* http_request_size_bytes_bucket
* http_response_size_bytes_bucket
* http_requests_total

with labels of action and controller to help identify popular
endpoints and their performance characteristics.
This commit is contained in:
Graham Christensen
2021-06-10 17:45:45 -04:00
parent db6bad108b
commit 71453dd341
3 changed files with 51 additions and 1 deletions

View File

@ -16,7 +16,8 @@ use Catalyst qw/ConfigLoader
Session
Session::Store::FastMmap
Session::State::Cookie
Captcha/,
Captcha
PrometheusTiny/,
'-Log=warn,fatal,error';
use CatalystX::RoleApplicator;
use YAML qw(LoadFile);
@ -47,6 +48,9 @@ __PACKAGE__->config(
file($ENV{'HYDRA_LDAP_CONFIG'})
) : undef
},
'Plugin::PrometheusTiny' => {
include_action_labels => 1,
},
'Plugin::Static::Simple' => {
send_etag => 1,
expires => 3600