diff --git a/cloud/prometheus/exporters/cadvisor/mode/storage.pm b/cloud/prometheus/exporters/cadvisor/mode/storage.pm index 8262ce412..39d5cb52d 100644 --- a/cloud/prometheus/exporters/cadvisor/mode/storage.pm +++ b/cloud/prometheus/exporters/cadvisor/mode/storage.pm @@ -115,7 +115,7 @@ sub set_counters { $self->{maps_counters}->{storage} = [ { label => 'usage', set => { - key_values => [ { name => 'used' }, { name => 'limit' }, { name => 'container' }, { name => 'pod' } ], + key_values => [ { name => 'used' }, { name => 'limit' } ], closure_custom_calc => $self->can('custom_usage_calc'), closure_custom_output => $self->can('custom_usage_output'), closure_custom_perfdata => $self->can('custom_usage_perfdata'), @@ -128,7 +128,7 @@ sub set_counters { sub prefix_container_output { my ($self, %options) = @_; - return "Container '" . $options{instance_value}->{display} . "' "; + return "Container '" . $options{instance_value}->{container} . "' [pod: " . $options{instance_value}->{pod} . "] "; } sub long_output { @@ -212,9 +212,9 @@ sub manage_selection { foreach my $result (@{$results}) { next if (!defined($result->{metric}->{$self->{labels}->{pod}}) || !defined($result->{metric}->{$self->{labels}->{container}})); $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{display} = $result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}; - $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{storage}->{$result->{metric}->{$self->{labels}->{device}}}->{container} = $result->{metric}->{$self->{labels}->{container}}; - $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{storage}->{$result->{metric}->{$self->{labels}->{device}}}->{pod} = $result->{metric}->{$self->{labels}->{pod}}; - $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{storage}->{$result->{metric}->{$self->{labels}->{device}}}->{device} = $result->{metric}->{$self->{labels}->{device}}; + $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{container} = $result->{metric}->{$self->{labels}->{container}}; + $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{pod} = $result->{metric}->{$self->{labels}->{pod}}; + $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{storage}->{$result->{metric}->{$self->{labels}->{device}}}->{display} = $result->{metric}->{$self->{labels}->{device}}; $self->{containers}->{$result->{metric}->{$self->{labels}->{pod}} . "_" . $result->{metric}->{$self->{labels}->{container}}}->{storage}->{$result->{metric}->{$self->{labels}->{device}}}->{$result->{metric}->{__name__}} = ${$result->{value}}[1]; } diff --git a/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm b/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm index e9780c20e..b73882d18 100644 --- a/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm +++ b/cloud/prometheus/exporters/nodeexporter/mode/cpudetailed.pm @@ -237,7 +237,7 @@ sub check_options { $self->SUPER::check_options(%options); $self->{metrics} = { - 'cpu' => "^node_cpu.*", + 'cpu' => "^node_cpu_seconds_total.*", }; foreach my $metric (@{$self->{option_results}->{metric_overload}}) { next if ($metric !~ /(.*),(.*)/); @@ -347,7 +347,7 @@ Example : --metric-overload='metric,^my_metric_name$' Default : - - cpu: ^node_cpu.* + - cpu: ^node_cpu_seconds_total.* =item B<--filter-counters>