oliver006/redis_exporter

how to scrape sentinel metrics

smarakdas314 opened this issue · 1 comments

Hey, can I monitor both redis and redis sentinel metrics with this exporter in one liner ? Couldn't find anything in readme.md with sentinel keyword regarding this.

Tried this approach, but didn't work

-redis.addr="redis://localhost:6379" -redis.addr="redis://localhost:26379"

redis defaults

redis_exporter --log-format=txt --namespace=redis --web.listen-address=:9121 --web.telemetry-path=/metrics

Maybe for sentinel metrics I have to run as a separate exporter on different port like 9122

redis_exporter --log-format=txt --namespace=redis --web.listen-address=:9122 --web.telemetry-path=/metrics -redis.addr="redis://localhost:26379"

I am intrested in redis_sentinel* metrics as well like:

redis_sentinel_master_ok_sentinels
redis_sentinel_master_sentinels
redis_sentinel_master_setting_ckquorum

Read through closed issues
https://github.com/oliver006/redis_exporter?tab=readme-ov-file#prometheus-configuration-to-scrape-multiple-redis-hosts

#429 (comment)

For now went with creating another systemd unit to scrape sentinel and expose it on 9122

cat /etc/systemd/system/redis_exporter_sentinel.service
[Unit]
Description=Prometheus redis exporter for sentinel
Documentation=https://github.com/oliver006/redis_exporter
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=prometheus
Group=prometheus
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/bin/redis_exporter --log-format=txt --namespace=redis --web.listen-address=:9122 --web.telemetry-path=/metrics -redis.addr=redis://localhost:26379

SyslogIdentifier=redis_exporter
Restart=always

[Install]
WantedBy=multi-user.target

Anyway readme could get an update regarding how to scrape sentinel metrics, as there was no mention of it.