Skip to content

Commit 4699efb

Browse files
authored
Update process CPU metric (#520)
With PR #498, we only have one process CPU metric. * Drop the label. * Update the name to match Prometheus naming. Signed-off-by: SuperQ <[email protected]>
1 parent c2365f8 commit 4699efb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Further Information
188188
| elasticsearch_os_load5 | gauge | 1 | Midterm load average
189189
| elasticsearch_os_load15 | gauge | 1 | Longterm load average
190190
| elasticsearch_process_cpu_percent | gauge | 1 | Percent CPU used by process
191-
| elasticsearch_process_cpu_time_seconds_sum | counter | 3 | Process CPU time in seconds
191+
| elasticsearch_process_cpu_seconds_total | counter | 1 | Process CPU time in seconds
192192
| elasticsearch_process_mem_resident_size_bytes | gauge | 1 | Resident memory in use by process in bytes
193193
| elasticsearch_process_mem_share_size_bytes | gauge | 1 | Shared memory in use by process in bytes
194194
| elasticsearch_process_mem_virtual_size_bytes | gauge | 1 | Total virtual memory used in bytes

collector/nodes.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1437,15 +1437,15 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no
14371437
{
14381438
Type: prometheus.CounterValue,
14391439
Desc: prometheus.NewDesc(
1440-
prometheus.BuildFQName(namespace, "process", "cpu_time_seconds_sum"),
1440+
prometheus.BuildFQName(namespace, "process", "cpu_seconds_total"),
14411441
"Process CPU time in seconds",
1442-
append(defaultNodeLabels, "type"), nil,
1442+
defaultNodeLabels, nil,
14431443
),
14441444
Value: func(node NodeStatsNodeResponse) float64 {
14451445
return float64(node.Process.CPU.Total) / 1000
14461446
},
14471447
Labels: func(cluster string, node NodeStatsNodeResponse) []string {
1448-
return append(defaultNodeLabelValues(cluster, node), "total")
1448+
return defaultNodeLabelValues(cluster, node)
14491449
},
14501450
},
14511451
{

0 commit comments

Comments
 (0)