Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1f3e93f
Add multi-target support (#1063)
pincher95 Aug 19, 2025
fd6d1c9
Add node label to elasticsearch_nodes_roles metric
pincher95 Nov 25, 2025
741be2f
Add node label to elasticsearch_nodes_roles metric
pincher95 Nov 25, 2025
425c57f
Bump actions/setup-go from 5.4.0 to 6.0.0 (#1086)
dependabot[bot] Oct 24, 2025
2f848d0
Bump the aws group with 4 updates (#1081)
dependabot[bot] Oct 24, 2025
4e3e45e
Bump actions/checkout from 4.2.2 to 5.0.0 (#1085)
dependabot[bot] Oct 24, 2025
a6bc1da
Bump github.com/prometheus/client_golang from 1.23.0 to 1.23.2 (#1084)
dependabot[bot] Oct 24, 2025
a4e32b4
Do not log input URL string
sysadmind Jun 12, 2025
ac8dbf3
Bump github.com/prometheus/exporter-toolkit from 0.14.0 to 0.14.1
dependabot[bot] Oct 24, 2025
873bf98
Bump github.com/prometheus/common from 0.65.0 to 0.66.1
dependabot[bot] Oct 24, 2025
4b339e8
Update Go (#1088)
SuperQ Oct 24, 2025
e376642
Fix mixed value types for disk watermark (#1055)
sysadmind Oct 28, 2025
7e157c3
Update common Prometheus files
prombot Oct 24, 2025
7acfdfc
Don't log collector errors (#1050)
SuperQ Oct 28, 2025
8b80a74
Bump github.com/prometheus/common from 0.67.1 to 0.67.2 (#1091)
dependabot[bot] Nov 5, 2025
c62a2ac
Bump the aws group with 4 updates (#1090)
dependabot[bot] Nov 5, 2025
2a9bf15
Bump golangci/golangci-lint-action from 7.0.0 to 8.0.0 (#1042)
dependabot[bot] Nov 5, 2025
130e4e4
Update common Prometheus files
prombot Nov 5, 2025
47c86f8
Fix release version for config.file
sysadmind Nov 5, 2025
37e7b69
Refactor README (#1095)
SuperQ Nov 19, 2025
eccabe2
Add node label to elasticsearch_nodes_roles metric
pincher95 Nov 26, 2025
e2d994f
Merge branch 'prometheus-community:master' into feature/add-node-labe…
pincher95 Nov 26, 2025
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
5 changes: 3 additions & 2 deletions collector/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var nodesRolesMetric = prometheus.NewDesc(

var (
defaultNodeLabels = []string{"cluster", "host", "name", "es_master_node", "es_data_node", "es_ingest_node", "es_client_node"}
defaultRoleLabels = []string{"cluster", "host", "name"}
defaultRoleLabels = []string{"cluster", "host", "name", "node"}
defaultThreadPoolLabels = append(defaultNodeLabels, "type")
defaultBreakerLabels = append(defaultNodeLabels, "breaker")
defaultIndexingPressureLabels = []string{"cluster", "host", "name", "indexing_pressure"}
Expand Down Expand Up @@ -1905,7 +1905,7 @@ func (c *Nodes) Collect(ch chan<- prometheus.Metric) {
return
}

for _, node := range nodeStatsResp.Nodes {
for nodeID, node := range nodeStatsResp.Nodes {
// Handle the node labels metric
roles := getRoles(node)

Expand All @@ -1919,6 +1919,7 @@ func (c *Nodes) Collect(ch chan<- prometheus.Metric) {
nodeStatsResp.ClusterName,
node.Host,
node.Name,
nodeID,
role,
}

Expand Down
72 changes: 36 additions & 36 deletions collector/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,18 +340,18 @@ func TestNodesStats(t *testing.T) {
elasticsearch_jvm_uptime_seconds{cluster="elasticsearch",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="127.0.0.1",name="bVrN1Hx",type="mapped"} 14.845
# HELP elasticsearch_nodes_roles Node roles
# TYPE elasticsearch_nodes_roles gauge
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="data"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="data_cold"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="data_content"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="data_frozen"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="data_hot"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="data_warm"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="ingest"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="master"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="ml"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="remote_cluster_client"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",role="transform"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="data"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="data_cold"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="data_content"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="data_frozen"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="data_hot"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="data_warm"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="ingest"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="master"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="ml"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="remote_cluster_client"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="127.0.0.1",name="bVrN1Hx",node="bVrN1HxvQLy795ZLNg2XNw",role="transform"} 0
# HELP elasticsearch_os_cpu_percent Percent CPU used by OS
# TYPE elasticsearch_os_cpu_percent gauge
elasticsearch_os_cpu_percent{cluster="elasticsearch",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="127.0.0.1",name="bVrN1Hx"} 23
Expand Down Expand Up @@ -799,18 +799,18 @@ func TestNodesStats(t *testing.T) {
elasticsearch_jvm_uptime_seconds{cluster="elasticsearch",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="172.17.0.2",name="9_P7yui",type="mapped"} 16.456
# HELP elasticsearch_nodes_roles Node roles
# TYPE elasticsearch_nodes_roles gauge
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="data"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="data_cold"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="data_content"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="data_frozen"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="data_hot"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="data_warm"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="ingest"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="master"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="ml"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="remote_cluster_client"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",role="transform"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="data"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="data_cold"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="data_content"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="data_frozen"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="data_hot"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="data_warm"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="ingest"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="master"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="ml"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="remote_cluster_client"} 0
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="9_P7yui",node="9_P7yuiySjG7OAN6NRbBRA",role="transform"} 0
# HELP elasticsearch_os_cpu_percent Percent CPU used by OS
# TYPE elasticsearch_os_cpu_percent gauge
elasticsearch_os_cpu_percent{cluster="elasticsearch",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="172.17.0.2",name="9_P7yui"} 30
Expand Down Expand Up @@ -1322,18 +1322,18 @@ func TestNodesStats(t *testing.T) {
elasticsearch_jvm_uptime_seconds{cluster="elasticsearch",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="172.17.0.2",name="aaf5a8a0bceb",type="mapped"} 21.844
# HELP elasticsearch_nodes_roles Node roles
# TYPE elasticsearch_nodes_roles gauge
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="data"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="data_cold"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="data_content"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="data_frozen"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="data_hot"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="data_warm"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="ingest"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="master"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="ml"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",role="transform"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="data"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="data_cold"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="data_content"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="data_frozen"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="data_hot"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="data_warm"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="ingest"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="master"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="ml"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="remote_cluster_client"} 1
elasticsearch_nodes_roles{cluster="elasticsearch",host="172.17.0.2",name="aaf5a8a0bceb",node="byoDEtBRSRGZyMKaIpmhCQ",role="transform"} 1
# HELP elasticsearch_os_cpu_percent Percent CPU used by OS
# TYPE elasticsearch_os_cpu_percent gauge
elasticsearch_os_cpu_percent{cluster="elasticsearch",es_client_node="true",es_data_node="true",es_ingest_node="true",es_master_node="true",host="172.17.0.2",name="aaf5a8a0bceb"} 37
Expand Down
Loading