Skip to content

Commit

Permalink
Remove non-existing CPU metrics (prometheus-community#498)
Browse files Browse the repository at this point in the history
* Remove non-existing CPU metrics

I couldn't find any Elasticsearch versions where these CPU metrics
were exposed, so they are always set to 0.

Signed-off-by: Jonathan Ballet <jonathan.ballet@camunda.com>

* remove more

Signed-off-by: Jonathan Ballet <jonathan.ballet@camunda.com>
  • Loading branch information
multani authored and Jeff Nadler committed Oct 27, 2022
1 parent d0e68b2 commit 2c9789f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
28 changes: 0 additions & 28 deletions collector/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -1448,34 +1448,6 @@ func NewNodes(logger log.Logger, client *http.Client, url *url.URL, all bool, no
return append(defaultNodeLabelValues(cluster, node), "total")
},
},
{
Type: prometheus.CounterValue,
Desc: prometheus.NewDesc(
prometheus.BuildFQName(namespace, "process", "cpu_time_seconds_sum"),
"Process CPU time in seconds",
append(defaultNodeLabels, "type"), nil,
),
Value: func(node NodeStatsNodeResponse) float64 {
return float64(node.Process.CPU.Sys) / 1000
},
Labels: func(cluster string, node NodeStatsNodeResponse) []string {
return append(defaultNodeLabelValues(cluster, node), "sys")
},
},
{
Type: prometheus.CounterValue,
Desc: prometheus.NewDesc(
prometheus.BuildFQName(namespace, "process", "cpu_time_seconds_sum"),
"Process CPU time in seconds",
append(defaultNodeLabels, "type"), nil,
),
Value: func(node NodeStatsNodeResponse) float64 {
return float64(node.Process.CPU.User) / 1000
},
Labels: func(cluster string, node NodeStatsNodeResponse) []string {
return append(defaultNodeLabelValues(cluster, node), "user")
},
},
{
Type: prometheus.CounterValue,
Desc: prometheus.NewDesc(
Expand Down
6 changes: 0 additions & 6 deletions collector/nodes_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,6 @@ type NodeStatsOSSwapResponse struct {

// NodeStatsOSCPUResponse defines node stats operating system CPU usage structure
type NodeStatsOSCPUResponse struct {
Sys int64 `json:"sys"`
User int64 `json:"user"`
Idle int64 `json:"idle"`
Steal int64 `json:"stolen"`
LoadAvg NodeStatsOSCPULoadResponse `json:"load_average"`
Percent int64 `json:"percent"`
}
Expand Down Expand Up @@ -330,8 +326,6 @@ type NodeStatsProcessMemResponse struct {
// NodeStatsProcessCPUResponse defines node stats process CPU usage structure
type NodeStatsProcessCPUResponse struct {
Percent int64 `json:"percent"`
Sys int64 `json:"sys_in_millis"`
User int64 `json:"user_in_millis"`
Total int64 `json:"total_in_millis"`
}

Expand Down

0 comments on commit 2c9789f

Please sign in to comment.