Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: report ElasticCloud data tiers nodes roles #652

Conversation

christophemorio
Copy link
Contributor

On ElasticCloud clusters, nodes have specific roles regarding data tier leveling:

  • data_hot
  • data_warm
  • data_cold
  • data_frozen

This PR add support for those roles.

curl -s http://localhost:9108/metrics | grep 'elasticsearch_nodes_roles'
# HELP elasticsearch_nodes_roles Node roles
# TYPE elasticsearch_nodes_roles gauge
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="data_hot"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="ingest"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="data_hot"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="ingest"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.236.46",name="instance-0000000003",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.236.46",name="instance-0000000003",role="data_warm"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.238.200",name="instance-0000000019",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.238.200",name="instance-0000000019",role="master"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.205",name="instance-0000000021",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.205",name="instance-0000000021",role="data_frozen"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.47",name="instance-0000000022",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.47",name="instance-0000000022",role="data_cold"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.154",name="instance-0000000018",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.154",name="instance-0000000018",role="master"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.162",name="instance-0000000007",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.162",name="instance-0000000007",role="data_warm"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.245.96",name="instance-0000000020",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.245.96",name="instance-0000000020",role="master"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.246.94",name="instance-0000000010",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.246.94",name="instance-0000000010",role="data_cold"} 1

Fixes #651

@christophemorio christophemorio force-pushed the support-elasticcloud-node-roles branch from d11b559 to c8a1083 Compare November 17, 2022 13:10
Copy link

@ariahi18 ariahi18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -84,7 +88,9 @@ func createRoleMetric(role string) *nodeMetric {
}

var (
defaultNodeLabels = []string{"cluster", "host", "name", "es_master_node", "es_data_node", "es_ingest_node", "es_client_node"}
defaultNodeLabels = []string{"cluster", "host", "name", "es_master_node", "es_data_node",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the format of the node metrics would need to change to add more roles. Adding all of these labels to the nodes metrics doesn't feel like a good idea to me. This variable appears to be referenced over 100 times in this file with most references being adding all of these labels to all of the metrics. A better approach may be to expose a new metric for node roles as a gauge with a 1 or 0 based on if the node has that role. I know that's a much different change to this and more involved, but I don't think it's sustainable to keep adding labels to these metrics.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sysadmind ,

It makes sens, I see the point of nodes labels multiplicity.
Then, I propose an approach by changing only outputs of elasticsearch_nodes_roles{} in the next commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output updated

$ curl -s http://localhost:9108/metrics | grep 'elasticsearch_nodes_roles'
# HELP elasticsearch_nodes_roles Node default roles
# TYPE elasticsearch_nodes_roles gauge
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="data_content"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="data_hot"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="ingest"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.138.46",name="instance-0000000016",role="transform"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="data_content"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="data_hot"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="ingest"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.22.143.78",name="instance-0000000015",role="transform"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.236.46",name="instance-0000000003",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.236.46",name="instance-0000000003",role="data_warm"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.236.46",name="instance-0000000003",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.238.200",name="instance-0000000019",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.238.200",name="instance-0000000019",role="master"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.238.200",name="instance-0000000019",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.205",name="instance-0000000021",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.205",name="instance-0000000021",role="data_frozen"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.47",name="instance-0000000022",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.47",name="instance-0000000022",role="data_cold"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.241.47",name="instance-0000000022",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.154",name="instance-0000000018",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.154",name="instance-0000000018",role="master"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.154",name="instance-0000000018",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.162",name="instance-0000000007",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.162",name="instance-0000000007",role="data_warm"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.242.162",name="instance-0000000007",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.245.96",name="instance-0000000020",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.245.96",name="instance-0000000020",role="master"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.245.96",name="instance-0000000020",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.246.94",name="instance-0000000010",role="client"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.246.94",name="instance-0000000010",role="data_cold"} 1
elasticsearch_nodes_roles{cluster="xxxx",host="172.25.246.94",name="instance-0000000010",role="remote_cluster_client"} 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: Christophe MORIO <cmorio@talend.com>
Signed-off-by: Christophe MORIO <cmorio@talend.com>
Signed-off-by: Christophe MORIO <cmorio@talend.com>
@christophemorio christophemorio force-pushed the support-elasticcloud-node-roles branch from a78f309 to b6b8ff7 Compare November 29, 2022 08:21
@eloo-abi
Copy link

eloo-abi commented Mar 7, 2023

Hi, are there any news for this PR?

@christophemorio
Copy link
Contributor Author

Hi @sysadmind , is it good for you ?

Copy link
Contributor

@sysadmind sysadmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sysadmind sysadmind merged commit 687e75e into prometheus-community:master Mar 23, 2023
@christophemorio christophemorio deleted the support-elasticcloud-node-roles branch April 4, 2023 12:38
SuperQ added a commit that referenced this pull request Jun 29, 2023
BREAKING CHANGES:

The flag `--es.cluster_settings` has been renamed to `--collector.clustersettings`.

* [CHANGE] Rename --es.cluster_settings to --collector.clustersettings
* [FEATURE] Add ILM metrics #513
* [ENHANCEMENT] Add ElasticCloud node roles to role label #652
* [ENHANCEMENT] Add ability to use AWS IAM role for authentication #653
* [ENHANCEMENT] Add metric for index replica count #483
* [BUGFIX] Set elasticsearch_clusterinfo_version_info guage to 1 #728
* [BUGFIX] Fix index field counts with nested fields #675

---------

Signed-off-by: Joe Adams <github@joeadams.io>
jaimeyh pushed a commit to sysdiglabs/elasticsearch_exporter that referenced this pull request Jun 14, 2024
…y#652)

* feat: additional elasticcloud roles

---------

Signed-off-by: Christophe MORIO <cmorio@talend.com>
jaimeyh added a commit to sysdiglabs/elasticsearch_exporter that referenced this pull request Jun 14, 2024
jaimeyh added a commit to sysdiglabs/elasticsearch_exporter that referenced this pull request Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report elasticcloud data tiers nodes roles
5 participants