Tasks: only execute the event if the plugin is interested in it
This commit is contained in:
@@ -117,6 +117,11 @@ sub new {
|
||||
type => "counter",
|
||||
help => "Number of tasks that have not been processed because the plugin does not exist."
|
||||
);
|
||||
$prometheus->declare(
|
||||
"notify_plugin_not_interested",
|
||||
type => "counter",
|
||||
help => "Number of tasks that have not been processed because the plugin was not interested in the event."
|
||||
);
|
||||
|
||||
my %plugins_by_name = map { ref $_ => $_ } @{$plugins};
|
||||
|
||||
@@ -190,6 +195,11 @@ sub dispatch_task {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!$task->{"event"}->interested($plugin)) {
|
||||
$self->{"prometheus"}->inc("notify_plugin_not_interested", $event_labels);
|
||||
return 0;
|
||||
}
|
||||
|
||||
$self->{"prometheus"}->inc("notify_plugin_executions", $event_labels);
|
||||
eval {
|
||||
my $start_time = [gettimeofday()];
|
||||
|
Reference in New Issue
Block a user