Skip to content

Conversation

@waddles
Copy link

@waddles waddles commented Nov 28, 2025

This commit enhances the service discovery for Redis/Valkey clusters, particularly for those using TLS and authentication.

Key changes:

  • The exporter now caches authentication credentials for dynamically discovered cluster nodes, allowing it to scrape metrics from clusters that require passwords.
  • The /discover-cluster-nodes endpoint now correctly preserves the rediss:// or valkeys:// scheme for TLS-enabled clusters.
  • The discovery handler can now connect to an arbitrary cluster specified by the target parameter, making it more flexible.
  • TLS configuration now includes the server name (SNI), improving security and compatibility.

A comprehensive set of tests has been added to validate these new capabilities, including scenarios for:

  • Discovering and scraping nodes in password-protected clusters.
  • Discovering and scraping nodes in TLS-enabled clusters.
  • Handling different URI schemes (redis://, rediss://, valkey://, valkeys://).

Note: Depends on oliver006/docker-valkey-cluster#1 to update the valkey-cluster.tmpl file used by envsubst when building the test cluster.

Wade Fitzpatrick added 2 commits November 28, 2025 16:15
This commit enhances the service discovery for Redis/Valkey clusters, particularly for those using TLS and authentication.

Key changes:
- The exporter now caches authentication credentials for dynamically discovered cluster nodes, allowing it to scrape metrics from clusters that require passwords.
- The `/discover-cluster-nodes` endpoint now correctly preserves the `rediss://` or `valkeys://` scheme for TLS-enabled clusters.
- The discovery handler can now connect to an arbitrary cluster specified by the `target` parameter, making it more flexible.
- TLS configuration now includes the server name (SNI), improving security and compatibility.

A comprehensive set of tests has been added to validate these new capabilities, including scenarios for:
- Discovering and scraping nodes in password-protected clusters.
- Discovering and scraping nodes in TLS-enabled clusters.
- Handling different URI schemes (`redis://`, `rediss://`, `valkey://`, `valkeys://`).
@oliver006
Copy link
Owner

Thanks for the PR - I'll try to get to reviewing it in the next couple of days.

Note: Depends on oliver006/docker-valkey-cluster#1 to update the valkey-cluster.tmpl file used by envsubst when building the test cluster.

I just merged the docker-valkey-cluster PR and released tags 8.1.4 and 9.0.0 so you should be able to pull those in.

@waddles
Copy link
Author

waddles commented Dec 1, 2025

Now depends on oliver006/docker-valkey-cluster#2 to actually build the test cluster with TLS.

I am testing on Apple Silicon so am not able to run the Redis 2.8 and KeyDB containers since they are x86 only. If I remove them from the Makefile options I get 3 failing tests that seem unrelated to my work.

--- FAIL: TestKeyDbMetrics (0.00s)
--- FAIL: TestSimultaneousMetricsHttpRequests (32.58s)
--- FAIL: TestExtractSearchIndexesMetrics (0.00s)

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.

2 participants