Closed AlexisBRENON closed 7 months ago
Can you try using a lua script?
I suppose that you suggest to use a script as demonstrated for the list size metrics, doesn't you ?
However, from the eval
documentation:
all names of keys that a script accesses must be explicitly provided as input key arguments
How do you handle that ? Which input key arguments are passed to the script from the redis-exporter ?
@AlexisBRENON the file you mentioned has this line
local keysPresent = redis.call("KEYS", "KEYS_PATTERN")
So it looks like that you can ignore that part of eval
doc.
At least I tried calling 'KEYS' and it worked.
Describe the problem
Hi. I use a scheme where I build multiple queues (redis sorted sets) following the pattern
<hour_bucket>:<lang>:queue
. As you can guess,hour_bucket
ranges from00
to23
. However thelang
value is the iso alpha 3 code of a language (fra
,eng
, etc.). I would like to track the length of all queues. While I can easily generate thehour_bucket
part, it’s more difficult to do it for thelang
. Generating it for all defined language would be quiet useless as most of the languages are never used, but I can’t tell before hand which one will be used. Using thecheck-keys
option is not very suitable as I can have a lot of keys in the DB, and so it requires a lot ofSCAN
calls...As a workaround, I think about 2 solutions:
queue_sizes
hash key with each field containing a single integer telling the size of each queuequeue_keys
the comma-separated list of queues to observe, and the exporter read this value to get the list of keys to checks.What version of redis_exporter are you running? Latest docker image
Redis Metrics Exporter v1.50.0 build date: sha1: b5e02003cea4b73054abe29433c264dec16cc1f0 Go: go1.20.3 GOOS: linux GOARCH: arm64
Running the exporter