Redis monitoring using Prometheus and Grafana

We have seen in one of the past articles about Redis clustering and how we can take backup and restore it. In this, we are going to see how we can monitor Redis nodes using Prometheus and Grafana. If you don’t know about Prometheus and Grafana read about it here. Now let’s see how we can do Redis monitoring using Prometheus and Grafana

We will divide this article into three phases. First, how to expose the metrics, second is where to save the time series data and the last part is how we can plot the data to make sense out of it.

How to expose Redis node metrics

For exposing the metrics you can run this Redis exporter.

https://github.com/oliver006/redis_exporter

You can build and run it. You can find all the configuration settings on the Github link. Once you run this you will see the metrics on the port specified. Next, we have to tell Prometheus to scrape and metrics and save it. This comes in the second section of our article.

Redis monitoring using Prometheus and Grafana

Saving metrics in Prometheus

Now if you are aware of how Prometheus works, what it does it you give config to Prometheus about the location it has to scrape and then it does its job and scrapes and saves the data. Below are the Prometheus config required.

scrape_configs:
  - job_name: redis_exporter
    static_configs:
    - targets: ['<<REDIS-EXPORTER-HOSTNAME>>:9121']

Now you will be able to see the data in Prometheus.

Plotting the data

For plotting the data we are going to use Grafana. Now you can tell Grafana to use Prometheus as a data store. After that, you can use import this dashboard to plot it.
https://grafana.com/grafana/dashboards/763

You can see here how to import Grafana dashboard

https://grafana.com/docs/grafana/latest/reference/export_import/

Now you should be able to see the plots on the Grafana dashboard.

This was how you can plot your Redis data to Grafana dashboard. If you like the article please share and subscribe.


Gaurav Yadav

Gaurav is cloud infrastructure engineer and a full stack web developer and blogger. Sportsperson by heart and loves football. Scale is something he loves to work for and always keen to learn new tech. Experienced with CI/CD, distributed cloud infrastructure, build systems and lot of SRE Stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.