From f907b12887b792927e372adcc00fd15b7aa62a87 Mon Sep 17 00:00:00 2001 From: Jaime Yera Hidalgo <106755265+jaimeyh@users.noreply.github.com> Date: Fri, 14 Jun 2024 11:47:24 +0200 Subject: [PATCH] Revert "feat: report ElasticCloud data tiers nodes roles (#652)" This reverts commit ad3c44268ec77835d10a7ca5c6c401a56a1f862f. --- collector/nodes.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/collector/nodes.go b/collector/nodes.go index 47ef445a..ba93a9b6 100644 --- a/collector/nodes.go +++ b/collector/nodes.go @@ -29,18 +29,10 @@ import ( func getRoles(node NodeStatsNodeResponse) map[string]bool { // default settings (2.x) and map, which roles to consider roles := map[string]bool{ - "master": false, - "data": false, - "data_hot": false, - "data_warm": false, - "data_cold": false, - "data_frozen": false, - "data_content": false, - "ml": false, - "remote_cluster_client": false, - "transform": false, - "ingest": false, - "client": true, + "master": false, + "data": false, + "ingest": false, + "client": true, } // assumption: a 5.x node has at least one role, otherwise it's a 1.7 or 2.x node if len(node.Roles) > 0 { @@ -1874,8 +1866,8 @@ func (c *Nodes) Collect(ch chan<- prometheus.Metric) { // Handle the node labels metric roles := getRoles(node) - for role, roleEnabled := range roles { - if roleEnabled { + for _, role := range []string{"master", "data", "client", "ingest"} { + if roles[role] { metric := createRoleMetric(role) ch <- prometheus.MustNewConstMetric( metric.Desc,