redis_exporter: exporter doesn't connect to redis
Greetings, I’m struggling for a few days to get some metrics from redis(openshift environment). Setup is: Redis 4 > prometheus > grafana.
Environment variables and prometheus.yml is as follows:
- name: REDIS_PASSWORD
value: password01!
- name: REDIS_ADDR
value: redis://127.0.0.1:6379
prometheus.yml:
- job_name: scraper-redis
static_configs:
- targets: ['redis-sev-redis-svc.redis.svc:9121']
labels:
alias: redis-sev-redis-svc.redis.svc
---------------
In prometheus, when I execute redis_up, the value is zero, therefore no info is going forward to grafana. But, in grafana i see that the variable “addr” is used to get the connection string, the redis://127.0.0.1:6379. I’m guessing the exporter cannot connect to that address for some reason. I have tried other db’s and exporters to check if there is a problem with prometheus, or my configuration, but it was not the case, they were working. I have encountered this issue only with this redis instance and exporter. Any suggestions will be appreciated.
Thank you in advance.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (7 by maintainers)
@oliver006 , I’ve enabled redis config for max memory data after that it is started working.
Thanks Oliver it worked, I used docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter --redis.addr=<host ip address>:7000
Found the issue. Didn’t know that Redis ignores the “REDIS_PASSWORD” variable, unless we enable password authentification(default redis configuration ignores authentification) or override the redis conf file, therefore the exporter could not connect to the DB. Thanks for your time! 😄