hydra-notify: make the prometheus endpoint configurable, default-off

This commit is contained in:
Your Name
2021-08-18 15:09:54 -04:00
parent 5d0ad5f649
commit 6d7ee27d25
5 changed files with 152 additions and 14 deletions

View File

@ -70,6 +70,29 @@ sub getStatsdConfig {
}
}
sub getHydraNotifyPrometheusConfig {
my ($config) = @_;
my $cfg = $config->{hydra_notify};
if (!defined($cfg) || ref $cfg ne "HASH") {
return undef;
}
my $cfg = $cfg->{prometheus};
if (!defined($cfg) || ref $cfg ne "HASH") {
return undef;
}
if (defined($cfg->{"listen_address"}) && defined($cfg->{"port"})) {
return {
"listen_address" => $cfg->{'listen_address'},
"port" => $cfg->{'port'},
};
}
return undef;
}
sub getBaseUrl {
my ($config) = @_;