To collect and display metrics data from your databases and other cluster components, you can connect your Prometheus or Grafana server to your Redis Enterprise Software cluster. Metrics are exposed at the node, database, shard and proxy levels.

  • Prometheus is an open-source systems monitoring and alerting toolkit that can scrape metrics from different sources.
  • Grafana is an open-source, feature-rich metrics dashboard and graph editor that can process Prometheus data.

You can use Prometheus and Grafana to:

  • Collect and display data metrics not available in the admin console

  • Set up automatic alerts for node or cluster events

  • Display Redis Enterprise Software metric data alongside data from other applications

Graphic showing how Prometheus and Grafana collect and display data from a Redis Enterprise Cluster. Prometheus scrapes metrics from the Redis Enterprise cluster and Grafana queries those metrics for visualization.

In each cluster, the metrics_exporter component listens on port 8070 and serves as a Prometheus scraping endpoint for obtaining metrics.

Quick start

To get started with custom monitoring:

  1. Create a directory called ‘prometheus’ on your local machine.

  2. Within that directory, create a file called prometheus.yml.

  3. Add the following contents to the yml file and replace <cluster_name> with your Redis cluster’s FQDN:

    Note:
    This is for development testing only (running in Docker).
    global:
      scrape_interval: 15s
      evaluation_interval: 15s
    
    # Attach these labels to any time series or alerts when communicating with
    # external systems (federation, remote storage, Alertmanager).
      external_labels:
        monitor: "prometheus-stack-monitor"
    
    # Load and evaluate rules in this file every 'evaluation_interval' seconds.
    #rule_files:
    # - "first.rules"
    # - "second.rules"
    
    scrape_configs:
    # scrape Prometheus itself
      - job_name: prometheus
        scrape_interval: 10s
        scrape_timeout: 5s
        static_configs:
          - targets: ["localhost:9090"]
    
    # scrape Redis Enterprise
      - job_name: redis-enterprise
        scrape_interval: 30s
        scrape_timeout: 30s
        metrics_path: /
        scheme: https
        tls_config:
          insecure_skip_verify: true
        static_configs:
          - targets: ["<cluster_name>:8070"]
    
  4. Set up your Prometheus and Grafana servers. To set up Prometheus and Grafana on Docker containers:

    1. Create a docker-compose.yml file:

      version: '3'
      services:
          prometheus-server:
              image: prom/prometheus
              ports:
                  - 9090:9090
              volumes:
                  - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
      
          grafana-ui:
              image: grafana/grafana
              ports:
                  - 3000:3000
              environment:
                  - GF_SECURITY_ADMIN_PASSWORD=secret
              links:
                  - prometheus-server:prometheus
      
    2. To start the containers, run:

      $ docker compose up -d
      
    3. To check that all the containers are up, run: docker ps

    4. In your browser, sign in to Prometheus at http://localhost:9090 to make sure the server is running.

    5. Select Status and then Targets to check that Prometheus is collecting data from the Redis Enterprise cluster.

      The Redis Enterprise target showing that Prometheus is connected to the Redis Enterprise Cluster.

      If Prometheus is connected to the cluster, you can type node_up in the Expression field on the Prometheus home page to see the cluster metrics.

  5. Configure the Grafana datasource:

    1. Sign in to Grafana. If you installed Grafana locally, go to http://localhost:3000 and sign in with:

      • Username: admin
      • Password: secret
    2. In the Grafana configuration menu, select Data Sources.

    3. Select Add data source.

    4. Select Prometheus from the list of data source types.

      The Prometheus data source in the list of data sources on Grafana.
    5. Enter the Prometheus information:

      • Name: redis-enterprise
      • URL: http://<your prometheus address>:9090
      • Access: Server
      The Prometheus connection form in Grafana.
    Note:
    • If the network port is not accessible to the Grafana server, select the Browser option from the Access menu.
    • In a testing environment, you can select Skip TLS verification.
  6. Add dashboards for cluster, node, and database metrics. To add preconfigured dashboards:

    1. In the Grafana dashboards menu, select Manage.
    2. Click Import.
    3. Copy one of the configurations into the Paste JSON field.
      database.json