oliver006 / redis_exporter

Prometheus Exporter for ValKey & Redis Metrics. Supports ValKey and Redis 2.x, 3.x, 4.x, 5.x, 6.x, and 7.x

Home Page:https://github.com/oliver006/redis_exporter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ingesting keys with slashes into prometheus

WimDeMeester opened this issue · comments

Describe the problem
I'm trying to include a lot of keys which have a name like

/elt/telif/target/coord/velocity_offset_radec

I try to add all the keys using the following command:

redis_exporter --redis.addr=127.0.0.1:6379 --check-keys /elt*

In the output, I can see that all the keys are found:

redis_key_size{db="db0",key="/elt/telif/target/coord/proper_motion_radec"} 39
redis_key_size{db="db0",key="/elt/telif/target/coord/radvel"} 31
redis_key_size{db="db0",key="/elt/telif/target/coord/rshift"} 31

However, I don't see the real values added. So no redis_key_value or redis_key_value_as_string can be seen in the stdout when starting up redis_exporter.

What version of redis_exporter are you running?
Please run redis_exporter --version if you're not sure what version you're running.
[ ] 0.3x.x
[x] 1.x.x

Running the exporter
What's the full command you're using to run the exporter? (please remove passwords and other sensitive data)

redis_exporter --redis.addr=127.0.0.1:6379 --check-keys /elt*

Expected behavior
What metrics are missing? What metrics are wrong? Is something missing that was present in an earlier version?
Did you upgrade from 0.3x.x to 1.0 and are scraping multiple hosts? Have a look here how the configuration changed.

I expect to have all the values for keys which look like /elt/telif/target/coord/velocity_offset_radec.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Not sure why the values don't get picked up. Could you try with the --debug flag?

I get the following messages:

DEBU[0416] c.Do() - running command: SELECT [0]         
DEBU[0416] c.Do() - done                                
DEBU[0416] c.Do() - running command: TYPE [/elt/met/fcs/devices/wcu-ccdm/lcs/axis_enable] 
DEBU[0416] c.Do() - done                                
DEBU[0416] c.Do() - running command: PFCOUNT [/elt/met/fcs/devices/wcu-ccdm/lcs/axis_enable] 
DEBU[0416] c.Do() - err: WRONGTYPE Key is not a valid HyperLogLog string value. 
DEBU[0416] c.Do() - done                                
DEBU[0416] c.Do() - running command: STRLEN [/elt/met/fcs/devices/wcu-ccdm/lcs/axis_enable] 
DEBU[0416] c.Do() - done                                
DEBU[0416] c.Do() - running command: GET [/elt/met/fcs/devices/wcu-ccdm/lcs/axis_enable] 
DEBU[0416] c.Do() - done                                
DEBU[0416] registerConstMetric( key_value_as_string , 1.00) err: label value "\x9fV%\xf2\xfe\u0097\x17\x00\x00\n\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00" is not valid UTF-8 

Interesting, let me try if I can reproduce this locally.

I had a new look into the problem and it seems that the format of the redis database was also changed. Instead of normal values, they are now writing objects in the database, so I now get

"\x15\x91V\xcbOm\x98\x17\x00\x00\t\x00\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00\xdb\xbb\\x\n\xc0b@"

and no longer

0.000463

as value. So I will need to write my own script to put everything in the prometheus database...

I guess this issue can be closed...