Skip to content

Commit 687e75e

Browse files
feat: report ElasticCloud data tiers nodes roles (#652)
* feat: additional elasticcloud roles --------- Signed-off-by: Christophe MORIO <cmorio@talend.com>
1 parent bc05ee5 commit 687e75e

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

collector/nodes.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,18 @@ import (
2929
func getRoles(node NodeStatsNodeResponse) map[string]bool {
3030
// default settings (2.x) and map, which roles to consider
3131
roles := map[string]bool{
32-
"master": false,
33-
"data": false,
34-
"ingest": false,
35-
"client": true,
32+
"master": false,
33+
"data": false,
34+
"data_hot": false,
35+
"data_warm": false,
36+
"data_cold": false,
37+
"data_frozen": false,
38+
"data_content": false,
39+
"ml": false,
40+
"remote_cluster_client": false,
41+
"transform": false,
42+
"ingest": false,
43+
"client": true,
3644
}
3745
// assumption: a 5.x node has at least one role, otherwise it's a 1.7 or 2.x node
3846
if len(node.Roles) > 0 {
@@ -1866,8 +1874,8 @@ func (c *Nodes) Collect(ch chan<- prometheus.Metric) {
18661874
// Handle the node labels metric
18671875
roles := getRoles(node)
18681876

1869-
for _, role := range []string{"master", "data", "client", "ingest"} {
1870-
if roles[role] {
1877+
for role, roleEnabled := range roles {
1878+
if roleEnabled {
18711879
metric := createRoleMetric(role)
18721880
ch <- prometheus.MustNewConstMetric(
18731881
metric.Desc,

0 commit comments

Comments
 (0)