Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to scrape sentinel metrics #963

Open
smarakdas314 opened this issue Oct 30, 2024 · 1 comment
Open

how to scrape sentinel metrics #963

smarakdas314 opened this issue Oct 30, 2024 · 1 comment
Assignees
Labels

Comments

@smarakdas314
Copy link

smarakdas314 commented Oct 30, 2024

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
@smarakdas314
Copy link
Author

smarakdas314 commented Oct 31, 2024

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.

@smarakdas314 smarakdas314 changed the title how to for sentinel metrics how to scrape sentinel metrics Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants