fix(prometheus/direct) : mode container-status - add ready container state management (#3295)
This commit is contained in:
parent
546dbd5d93
commit
c3b419e604
|
@ -183,7 +183,7 @@ sub manage_selection {
|
|||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{perf} = $result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}};
|
||||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{restarts} = ${$result->{value}}[1] if ($result->{metric}->{__name__} =~ /restarts/);
|
||||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{state} = ${$result->{value}}[1] if ($result->{metric}->{__name__} =~ /ready/);
|
||||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{status} = $result->{metric}->{__name__} if ($result->{metric}->{__name__} =~ /running|terminated|waiting/ && ${$result->{value}}[1] == 1);
|
||||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{status} = $result->{metric}->{__name__} if ($result->{metric}->{__name__} =~ /ready|running|terminated|waiting/ && ${$result->{value}}[1] == 1);
|
||||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{reason} = "";
|
||||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{reason} = $result->{metric}->{reason} if ($result->{metric}->{__name__} =~ /reason/ && ${$result->{value}}[1] == 1);
|
||||
$self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{namespace} = $result->{metric}->{namespace};
|
||||
|
|
Loading…
Reference in New Issue