@@ -47,9 +47,9 @@ func TestCollectResourceMetrics(t *testing.T) {
47
47
testTime := metav1 .NewTime (time .Unix (2 , 0 )) // a static timestamp: 2000
48
48
interestedMetrics := []string {
49
49
"scrape_error" ,
50
- "node_cpu_usage_seconds " ,
50
+ "node_cpu_usage_seconds_total " ,
51
51
"node_memory_working_set_bytes" ,
52
- "container_cpu_usage_seconds " ,
52
+ "container_cpu_usage_seconds_total " ,
53
53
"container_memory_working_set_bytes" ,
54
54
}
55
55
@@ -85,9 +85,9 @@ func TestCollectResourceMetrics(t *testing.T) {
85
85
},
86
86
summaryErr : nil ,
87
87
expectedMetrics : `
88
- # HELP node_cpu_usage_seconds [ALPHA] Cumulative cpu time consumed by the node in core-seconds
89
- # TYPE node_cpu_usage_seconds gauge
90
- node_cpu_usage_seconds 10 2000
88
+ # HELP node_cpu_usage_seconds_total [ALPHA] Cumulative cpu time consumed by the node in core-seconds
89
+ # TYPE node_cpu_usage_seconds_total counter
90
+ node_cpu_usage_seconds_total 10 2000
91
91
# HELP node_memory_working_set_bytes [ALPHA] Current working set of the node in bytes
92
92
# TYPE node_memory_working_set_bytes gauge
93
93
node_memory_working_set_bytes 1000 2000
@@ -156,11 +156,11 @@ func TestCollectResourceMetrics(t *testing.T) {
156
156
# HELP scrape_error [ALPHA] 1 if there was an error while getting container metrics, 0 otherwise
157
157
# TYPE scrape_error gauge
158
158
scrape_error 0
159
- # HELP container_cpu_usage_seconds [ALPHA] Cumulative cpu time consumed by the container in core-seconds
160
- # TYPE container_cpu_usage_seconds gauge
161
- container_cpu_usage_seconds {container="container_a",namespace="namespace_a",pod="pod_a"} 10 2000
162
- container_cpu_usage_seconds {container="container_a",namespace="namespace_b",pod="pod_b"} 10 2000
163
- container_cpu_usage_seconds {container="container_b",namespace="namespace_a",pod="pod_a"} 10 2000
159
+ # HELP container_cpu_usage_seconds_total [ALPHA] Cumulative cpu time consumed by the container in core-seconds
160
+ # TYPE container_cpu_usage_seconds_total counter
161
+ container_cpu_usage_seconds_total {container="container_a",namespace="namespace_a",pod="pod_a"} 10 2000
162
+ container_cpu_usage_seconds_total {container="container_a",namespace="namespace_b",pod="pod_b"} 10 2000
163
+ container_cpu_usage_seconds_total {container="container_b",namespace="namespace_a",pod="pod_a"} 10 2000
164
164
# HELP container_memory_working_set_bytes [ALPHA] Current working set of the container in bytes
165
165
# TYPE container_memory_working_set_bytes gauge
166
166
container_memory_working_set_bytes{container="container_a",namespace="namespace_a",pod="pod_a"} 1000 2000
0 commit comments