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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions collector/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@ 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,
"ingest": false,
"client": true,
"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,
}
// 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 {
Expand Down Expand Up @@ -1866,8 +1874,8 @@ func (c *Nodes) Collect(ch chan<- prometheus.Metric) {
// Handle the node labels metric
roles := getRoles(node)

for _, role := range []string{"master", "data", "client", "ingest"} {
if roles[role] {
for role, roleEnabled := range roles {
if roleEnabled {
metric := createRoleMetric(role)
ch <- prometheus.MustNewConstMetric(
metric.Desc,
Expand Down