diff --git a/centreon-plugins/cloud/prometheus/restapi/mode/targetstatus.pm b/centreon-plugins/cloud/prometheus/restapi/mode/targetstatus.pm index 658090b8b..6f10556a4 100644 --- a/centreon-plugins/cloud/prometheus/restapi/mode/targetstatus.pm +++ b/centreon-plugins/cloud/prometheus/restapi/mode/targetstatus.pm @@ -212,7 +212,7 @@ sub manage_selection { last_error => $active->{lastError}, }; - foreach my $label (keys $active->{labels}) { + foreach my $label (keys %{$active->{labels}}) { $self->{targets}->{$active->{scrapeUrl}}->{labels} .= "[" . $label . " = " . $active->{labels}->{$label} . "]"; } $self->{global}->{$active->{health}}++;