Last active
April 12, 2024 08:18
-
-
Save nelsondev19/722727fdba11d846e39dc99f8064f7fe to your computer and use it in GitHub Desktop.
How to monitor Redis with Prometheus and Grafana | Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
grafana: | |
image: grafana/grafana | |
ports: | |
- 3000:3000 | |
prometheus: | |
image: prom/prometheus | |
ports: | |
- 9090:9090 | |
volumes: | |
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro | |
redis: | |
image: "bitnami/redis:latest" | |
ports: | |
- 6379:6379 | |
environment: | |
- REDIS_REPLICATION_MODE=master | |
- REDIS_PASSWORD=my_master_password | |
redis-exporter: | |
image: oliver006/redis_exporter | |
ports: | |
- 9121:9121 | |
environment: | |
REDIS_ADDR: "redis:6379" | |
REDIS_USER: null | |
REDIS_PASSWORD: my_master_password | |
links: | |
- redis | |
- prometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 15s | |
evaluation_interval: 15s | |
scrape_configs: | |
- job_name: prometheus | |
static_configs: | |
- targets: ['localhost:9090'] | |
- job_name: redis-exporter | |
static_configs: | |
- targets: ['redis-exporter:9121'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run Docker Compose
Check status of Prometheus and Redis Exporter
Visit Grafana Dashboard
Default
User: admin
Password: admin
Add data source
Save and test
Import Redis Dashboard for Prometheus
For this we will use a Dashboard created by the community
https://grafana.com/grafana/dashboards/763
Import JSON of code
Code: 763
JSON:
https://grafana.com/api/dashboards/763/revisions/3/download
Dashboard