-
Notifications
You must be signed in to change notification settings - Fork 926
Open
Labels
Description
Describe the problem
When configuring redis_exporter to scan Valkey stream keys (e.g., --check-streams=events:*) in a Sentinel-managed Valkey deployment, the exporter attempts to execute SELECT before scanning keys. This results in ERR unknown command 'SELECT' because Valkey (≤8.x) does not support SELECT (at least in Sentinel and/or Cluster mode). Stream metrics (e.g., valkey_stream_length) are not exposed due to this error.
What version of redis_exporter are you running?
[X] 1.x.x
- Version:
1.73.0
Running the exporter
redis_exporter --check-streams=events:* --exclude-latency-histogram-metrics=trueExpected behavior
- The exporter should avoid the
SELECTcommand in Sentinel/Cluster mode and scan keys directly in database 0. - Stream metrics like
valkey_stream_length{key="events:xxx"}should be exposed without errors.
Additional context
- Valkey Documentation: The Valkey
SELECTcommand docs state thatSELECTwill be supported in Cluster mode starting in Valkey 9.0 (tentative release: September 2025), but it may remain unsupported in Sentinel mode. - Workarounds:
- Gracefully ignore
SELECTerrors, db is a property of the client connection in Valkey (log a warning). - Add new flag(s) (e.g.,
--skip-db-selection,--db=0) to disableSELECTexplicitly, or to configure the database that needs to be used while establishing a connection.
- Gracefully ignore