Skip to content

Conversation

@pincher95
Copy link
Contributor

@pincher95 pincher95 commented Nov 26, 2025

This pull request updates the elasticsearch_nodes_roles metric to include the node ID as a new label, improving the uniqueness and traceability of reported node roles. The change modifies both the metric collection logic and the related tests to ensure the new label is present and validated.

Enhancements to Node Role Metrics:

  • Added the node (node ID) label to the elasticsearch_nodes_roles metric definition, making each metric instance uniquely identifiable by node ID in addition to cluster, host, and name.
  • Updated the metric collection loop in collector/nodes.go to iterate over node IDs and include the node ID as a label value when emitting node role metrics. [1] [2]

Test Updates:

  • Modified test expectations in collector/nodes_test.go to require the new node label in all elasticsearch_nodes_roles metric assertions, ensuring tests validate the updated metric format. [1] [2] [3]

pincher95 and others added 21 commits November 26, 2025 09:41
* Add multi-target support

Signed-off-by: pincher95 <[email protected]>

* Update example-prometheus.yml

Signed-off-by: pincher95 <[email protected]>

* Make `es.uri` optional by setting default to empty string check if it's empty and if so, don't parse it
Signed-off-by: pincher95 <[email protected]>

Signed-off-by: pincher95 <[email protected]>

* Update README.md

Signed-off-by: pincher95 <[email protected]>

* Add sanity target scheme validation

Signed-off-by: pincher95 <[email protected]>

* Change yaml package to go.yaml.in/yaml/v3

Signed-off-by: pincher95 <[email protected]>

* Update yaml package to go.yaml.in/yaml/v3

Signed-off-by: pincher95 <[email protected]>

* Update CHANGELOG.md

Signed-off-by: pincher95 <[email protected]>

* Remove whitespaces from README.md

Signed-off-by: pincher95 <[email protected]>

* Add testing for apikey authentication module
Update examples/auth_modules.yml
Fix main.go to apply userpass credentials only if the module type is explicitly set to userpass.

Signed-off-by: pincher95 <[email protected]>

* Add Load-time validation for the auth module config file during startup
Keep light-weight validation for the probe params during runtime
Add AWS SigV4 authentication module support

Signed-off-by: pincher95 <[email protected]>

* Expose error in the logger

Signed-off-by: pincher95 <[email protected]>

* Add TLS config per target support
Add TLS config validation
Update config test to include TLS config

Signed-off-by: pincher95 <[email protected]>

* Indices and Shards collectors now fetch cluster_name once from GET / when no clusterinfo retriever is attached, avoiding the previous "unknown_cluster" label.

Signed-off-by: pincher95 <[email protected]>

* Removed the special-case logic that redirected /metrics?target= requests to /probe.
Updated auth_modules.yml to include AWS SigV4 signing and mTLS support.

Signed-off-by: pincher95 <[email protected]>

* Add license headers to all new files

Signed-off-by: pincher95 <[email protected]>

* Fixes for relative paths in multi-target mode

Signed-off-by: pincher95 <[email protected]>

* Bump github.com/prometheus/client_golang from 1.22.0 to 1.23.0 (prometheus-community#1065)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.22.0...v1.23.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>

* Add target schema validation, http/https only
Add tls auth type support in multi-target mode
Update README.md, examples/auth_modules.yml, tests

Signed-off-by: pincher95 <[email protected]>

* Cleanup

Signed-off-by: pincher95 <[email protected]>

* Fix tls auth type validation

Signed-off-by: pincher95 <[email protected]>

* Remove aws.region validation

Signed-off-by: pincher95 <[email protected]>

* Add temp file cleanup in config_test.go

Signed-off-by: pincher95 <[email protected]>

* Add copyright header to config_test.go

Signed-off-by: pincher95 <[email protected]>

* Add version metric to the per-probe registry
Update roundtripper.go to use region from config or environment resolver if not provided in config file (AWS_REGION)
Update probe.go to accept module even if region omitted; environment resolver can provide it
Update config.go to use region as optional field
Update main.go to use region from config or environment resolver if not provided in config file (AWS_REGION) and update roundtripper.go to use region from config or environment resolver if not provided in config file (AWS_REGION)

Signed-off-by: pincher95 <[email protected]>

---------

Signed-off-by: pincher95 <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Yuri Tsuprun <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
- Add 'node' (node ID) label to elasticsearch_nodes_roles metric
- Node ID comes from the map key in nodes stats response (no extra API calls)
- Update tests for ES versions 5.6.16, 6.8.8, and 7.13.1

Signed-off-by: pincher95 <[email protected]>
- Add 'node' (node ID) label to elasticsearch_nodes_roles metric
- Node ID comes from the map key in nodes stats response (no extra API calls)
- Update tests for ES versions 5.6.16, 6.8.8, and 7.13.1

Signed-off-by: pincher95 <[email protected]>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5.4.0 to 6.0.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@0aaccfd...4469467)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
Bumps the aws group with 4 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) and [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2).

Updates `github.com/aws/aws-sdk-go-v2` from 1.37.2 to 1.39.2
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@v1.37.2...v1.39.2)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.30.3 to 1.31.12
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@v1.30.3...config/v1.31.12)

Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.18.3 to 1.18.16
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@config/v1.18.3...config/v1.18.16)

Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.36.0 to 1.38.6
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@v1.36.0...service/sts/v1.38.6)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.39.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.31.12
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-version: 1.18.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sts
  dependency-version: 1.38.6
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@11bd719...08c6903)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
…theus-community#1084)

Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.23.0 to 1.23.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.23.0...v1.23.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-version: 1.23.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
The error itself already has the sanitized URL so there is no need to log the sensitive input string.

Signed-off-by: Joe Adams <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.14.0 to 0.14.1.
- [Release notes](https://github.com/prometheus/exporter-toolkit/releases)
- [Commits](prometheus/exporter-toolkit@v0.14.0...v0.14.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/exporter-toolkit
  dependency-version: 0.14.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.65.0 to 0.66.1.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md)
- [Commits](prometheus/common@v0.65.0...v0.66.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-version: 0.66.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: pincher95 <[email protected]>
* Update minimum Go version to 1.24.0.
* Update build to Go 1.25.
* Cleanup disabled CircleCI pipeline.

Signed-off-by: SuperQ <[email protected]>
Signed-off-by: pincher95 <[email protected]>
* Fix mixed value types for disk watermark

The disk watermark values can be a ratio or percentage according to the docs[1], however when set to a percentage, the defaults become an object and therefore fails to parse. In that case, we really only care about what the user set. Adds a test to confirm a fix for prometheus-community#1044.

Fixes prometheus-community#1044

[1] https://www.elastic.co/docs/reference/elasticsearch/configuration-reference/cluster-level-shard-allocation-routing-settings#disk-based-shard-allocation

Signed-off-by: Joe Adams <[email protected]>

* Add missing test fixture

Signed-off-by: Joe Adams <[email protected]>

---------

Signed-off-by: Joe Adams <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: prombot <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Avoid logging collector failures at Error level to avoid log spam.

Signed-off-by: SuperQ <[email protected]>
Signed-off-by: pincher95 <[email protected]>
…ommunity#1091)

Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.67.1 to 0.67.2.
- [Release notes](https://github.com/prometheus/common/releases)
- [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md)
- [Commits](prometheus/common@v0.67.1...v0.67.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/common
  dependency-version: 0.67.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
Bumps the aws group with 4 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/credentials](https://github.com/aws/aws-sdk-go-v2) and [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2).

Updates `github.com/aws/aws-sdk-go-v2` from 1.39.2 to 1.39.5
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@v1.39.2...v1.39.5)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.31.12 to 1.31.16
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@config/v1.31.12...config/v1.31.16)

Updates `github.com/aws/aws-sdk-go-v2/credentials` from 1.18.16 to 1.18.20
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/config/v1.18.20/CHANGELOG.md)
- [Commits](aws/aws-sdk-go-v2@config/v1.18.16...config/v1.18.20)

Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.38.6 to 1.39.0
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/changelog-template.json)
- [Commits](aws/aws-sdk-go-v2@service/sts/v1.38.6...v1.39.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.39.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.31.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws
- dependency-name: github.com/aws/aws-sdk-go-v2/credentials
  dependency-version: 1.18.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: aws
- dependency-name: github.com/aws/aws-sdk-go-v2/service/sts
  dependency-version: 1.39.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: aws
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
…mmunity#1042)

Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@1481404...4afd733)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: prombot <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: Joe Adams <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Move the metrics list to a separate markdown file to reduce the README
size below the 25k bytes limit of Dockerhub.

Signed-off-by: SuperQ <[email protected]>
Signed-off-by: pincher95 <[email protected]>
- Add 'node' (node ID) label to elasticsearch_nodes_roles metric
- Node ID comes from the map key in nodes stats response (no extra API calls)
- Update tests for ES versions 5.6.16, 6.8.8, and 7.13.1

Signed-off-by: pincher95 <[email protected]>
@pincher95 pincher95 changed the title Feature/add node label to nodes roles feat: add node label on elasticsearch_nodes_roles metric Nov 26, 2025
@pincher95
Copy link
Contributor Author

resolve #1105

@sysadmind
Copy link
Contributor

This PR description seems to be inaccurate. Please update the description with the accurate description of the intent of this PR.

@pincher95
Copy link
Contributor Author

@sysadmind updated

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.

4 participants