dragonflydb / dragonflydb/dragonfly-operator
ENHANCEMENT - Add key monitoring as in prometheus-redis-exporter
- Dominant language
- Go
- Stars
- 357
- Forks
- 111
- PR merge metrics
- No merged PRs in 30d
Description
The widely used promenteus-redis-exporter has the ability to monitor specific keys and provide the key sizes. Can we add these metrics to the built-in monitoring?
check-keys-batch-size | REDIS_EXPORTER_CHECK_KEYS_BATCH_SIZE | Approximate number of keys to process in each execution. This is basically the COUNT option that will be passed into the SCAN command as part of the execution of the key or key group metrics, see COUNT option. Larger value speeds up scanning. Still Redis is a single-threaded app, huge COUNT can affect production environment.
-- | -- | --
count-keys | REDIS_EXPORTER_COUNT_KEYS | Comma separated list of patterns to count, eg: db3=sessions:* will count all keys with prefix sessions: from db 3. db defaults to 0 if omitted. Warning: The exporter runs SCAN to count the keys. This might not perform well on large databases.
check-keys | REDIS_EXPORTER_CHECK_KEYS | Comma separated list of key patterns to export value and length/size, eg: db3=user_count will export key user_count from db 3. db defaults to 0 if omitted. The key patterns specified with this flag will be found using SCAN. Use this option if you need glob pattern matching; check-single-keys is faster for non-pattern keys. Warning: using --check-keys to match a very large number of keys can slow down the exporter to the point where it doesn't finish scraping the redis instance. --check-keys doesn't work in fluster mode as "SCAN" does not work across multiple instances.
-- | -- | --
check-single-keys | REDIS_EXPORTER_CHECK_SINGLE_KEYS | Comma separated list of keys to export value and length/size, eg: db3=user_count will export key user_count from db 3. db defaults to 0 if omitted. The keys specified with this flag will be looked up directly without any glob pattern matching. Use this option if you don't need glob pattern matching; it is faster than check-keys.
Contributor guide
Research direction
Start by tracing the built-in monitoring entry point and comparing its metrics with prometheus-redis-exporter. Review the check-keys-batch-size, count-keys, check-keys, and check-single-keys options alongside Redis SCAN behavior. Done means the requested key counts, values, and sizes are exposed with the documented configuration and monitoring works within the stated limitations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, prometheus, redis
- Domain
- databases, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100