@@ -342,26 +342,51 @@ func TestPowerCollector(t *testing.T) {
342342 })
343343 })
344344
345- t .Run ("Process Metrics Node Name Label" , func (t * testing.T ) {
346- expectedLabels := map [string ]string {"node_name" : "test-node" }
345+ t .Run ("Process Metrics Labels" , func (t * testing.T ) {
346+ expectedLabels := map [string ]string {
347+ "node_name" : "test-node" ,
348+ "pid" : "123" ,
349+ "comm" : "test-process" ,
350+ "exe" : "/usr/bin/123" ,
351+ "type" : "regular" ,
352+ "zone" : "package-0" ,
353+ }
347354 assertMetricLabelValues (t , registry , "kepler_process_cpu_joules_total" , expectedLabels )
348355 assertMetricLabelValues (t , registry , "kepler_process_cpu_watts" , expectedLabels )
349356 })
350357
351- t .Run ("Container Metrics Node Name Label" , func (t * testing.T ) {
352- expectedLabels := map [string ]string {"node_name" : "test-node" }
358+ t .Run ("Container Metrics Labels" , func (t * testing.T ) {
359+ expectedLabels := map [string ]string {
360+ "node_name" : "test-node" ,
361+ "container_id" : "abcd-efgh" ,
362+ "container_name" : "test-container" ,
363+ "runtime" : "podman" ,
364+ "zone" : "package-0" ,
365+ }
353366 assertMetricLabelValues (t , registry , "kepler_container_cpu_joules_total" , expectedLabels )
354367 assertMetricLabelValues (t , registry , "kepler_container_cpu_watts" , expectedLabels )
355368 })
356369
357- t .Run ("VM Metrics Node Name Label" , func (t * testing.T ) {
358- expectedLabels := map [string ]string {"node_name" : "test-node" }
370+ t .Run ("VM Metrics Labels" , func (t * testing.T ) {
371+ expectedLabels := map [string ]string {
372+ "node_name" : "test-node" ,
373+ "vm_id" : "abcd-efgh" ,
374+ "vm_name" : "test-vm" ,
375+ "hypervisor" : "kvm" ,
376+ "zone" : "package-0" ,
377+ }
359378 assertMetricLabelValues (t , registry , "kepler_vm_cpu_joules_total" , expectedLabels )
360379 assertMetricLabelValues (t , registry , "kepler_vm_cpu_watts" , expectedLabels )
361380 })
362381
363- t .Run ("Pod Metrics Node Name Label" , func (t * testing.T ) {
364- expectedLabels := map [string ]string {"node_name" : "test-node" }
382+ t .Run ("Pod Metrics Labels" , func (t * testing.T ) {
383+ expectedLabels := map [string ]string {
384+ "node_name" : "test-node" ,
385+ "pod_id" : "test-pod" ,
386+ "pod_name" : "test-pod" ,
387+ "pod_namespace" : "default" ,
388+ "zone" : "package-0" ,
389+ }
365390 assertMetricLabelValues (t , registry , "kepler_pod_cpu_joules_total" , expectedLabels )
366391 assertMetricLabelValues (t , registry , "kepler_pod_cpu_watts" , expectedLabels )
367392 })
0 commit comments