hydra-notify: support sending diagnostic dumps to STDERR on request
This commit is contained in:
@ -99,6 +99,7 @@ my $listener = Hydra::PostgresListener->new($dbh);
|
||||
$listener->subscribe("build_started");
|
||||
$listener->subscribe("build_finished");
|
||||
$listener->subscribe("step_finished");
|
||||
$listener->subscribe("hydra_notify_dump_metrics");
|
||||
|
||||
sub runPluginsForEvent {
|
||||
my ($event) = @_;
|
||||
@ -145,6 +146,11 @@ while (!$queued_only) {
|
||||
|
||||
$prom->inc("notify_event", { channel => $channelName });
|
||||
|
||||
if ($channelName eq "hydra_notify_dump_metrics") {
|
||||
print STDERR "Dumping prometheus metrics:\n${\$prom->format}\n";
|
||||
next;
|
||||
}
|
||||
|
||||
eval {
|
||||
my $event = Hydra::Event->new_event($channelName, $message->{"payload"});
|
||||
runPluginsForEvent($event);
|
||||
|
Reference in New Issue
Block a user