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 cluster. Metrics are exposed at the node, database, shard and proxy levels.

  • Prometheus (https://prometheus.io/) is an open-source systems monitoring and alerting toolkit that can scrape metrics from different sources.
  • Grafana (https://grafana.com/) is an open-source, feature-rich metrics dashboard and graph editor that can process Prometheus data.

grafana-prometheus

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. Copy this Prometheus configuration into ./prometheus/prometheus.yml in your current folder:

    • If you already have Prometheus installed, just copy the ‘redis-enterprise’ job into your existing Prometheus configuration and skip the next step.
    • Replace <cluster_name> with your actual cluster FQDN.
    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"]
    
  2. Set up your Prometheus and Grafana servers. To set up Prometheus and Grafana on Docker containers:

    1. Create a docker-compose.yml file with this yaml contents:

      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, login to Prometheus at http://localhost:9090 to make sure the server is running.

    5. Enter node_up in the Expression field. If Prometheus is connected to the Redis Enterprise cluster, the cluster metrics are shown.

  3. Configure the Grafana datasource:

    1. Login to Grafana. If you installed Grafana locally, go to http://localhost:3000 and login with:

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

      data-sources

    3. Add a new data source with:

      • Name: redis-enterprise
      • Type: Prometheus
      • URL: http://<your prometheus address>:9090
      • Access: Server

    prometheus-connection

    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.
  4. 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
      node.json