redis_exporter icon indicating copy to clipboard operation
redis_exporter copied to clipboard

redis_instance_info metric goes stale on HA switchovers due to role label

Open guillemj opened this issue 2 years ago • 2 comments

Describe the problem

The redis_instance_info metric contains the role label. The problem is that on HA setups with master/slave replication (where the nodes can switch from master to slave and vice versa at any time) , the metric will go stale for a while as it will appear both as master and slave until the stale one disappears.

What version of redis_exporter are you running?

1.33.0

Running the exporter

/usr/bin/prometheus-redis-exporter -web.listen-address localhost:9121 -redis.addr redis://127.0.0.1:6379

Expected behavior

To avoid the stale metrics problem I think the role needs to be split into its own metric, one per role name, and its value indicating whether that role is in effect right now, like other similar state metrics are handled in the node exporter f.ex.

One problem is that I'm not certain the list of role names is something bounded. Redis itself has master and slave, keydb also has active-replica. Not sure whether other implementations might have other states.

guillemj avatar Mar 07 '22 20:03 guillemj

Hi!

I didn't see any commit addressing this, so I'm not sure whether I missed something, or perhaps the closure implies this is "wontfix" or similar?

guillemj avatar Feb 05 '23 21:02 guillemj

Good catch, my bad, there was indeed not a fix and I accidentally closed this with a few other tickets as it was very old.

I did not have time to look into this but let me re-open and maybe I'll get to it at some point.

oliver006 avatar Feb 07 '23 14:02 oliver006