|
| 1 | + |
| 2 | +You can use Prometheus and Grafana to collect and visualize your Redis Enterprise Software metrics. |
| 3 | + |
| 4 | +Metrics are exposed at the cluster, node, database, shard, and proxy levels. |
| 5 | + |
| 6 | + |
| 7 | +- [Prometheus](https://prometheus.io/) is an open source systems monitoring and alerting toolkit that aggregates metrics from different sources. |
| 8 | +- [Grafana](https://grafana.com/) is an open source metrics visualization tool that processes Prometheus data. |
| 9 | + |
| 10 | +You can use Prometheus and Grafana to: |
| 11 | +- Collect and display metrics not available in the admin console |
| 12 | + |
| 13 | +- Set up automatic alerts for node or cluster events |
| 14 | + |
| 15 | +- Display Redis Enterprise Software metrics alongside data from other systems |
| 16 | + |
| 17 | +{{<image filename="images/rs/grafana-prometheus.png" alt="Graphic showing how Prometheus and Grafana collect and display data from a Redis Enterprise Cluster. Prometheus collects metrics from the Redis Enterprise cluster, and Grafana queries those metrics for visualization.">}} |
| 18 | + |
| 19 | +In each cluster, the metrics_exporter process exposes Prometheus metrics on port 8070. |
| 20 | +Redis Enterprise version 7.8.2 introduces a preview of the new metrics stream engine that exposes the v2 Prometheus scraping endpoint at `https://<IP>:8070/v2`. |
| 21 | + |
| 22 | +## Quick start |
| 23 | + |
| 24 | +To get started with Prometheus and Grafana: |
| 25 | + |
| 26 | +1. Create a directory called 'prometheus' on your local machine. |
| 27 | + |
| 28 | +1. Within that directory, create a configuration file called `prometheus.yml`. |
| 29 | +1. Add the following contents to the configuration file and replace `<cluster_name>` with your Redis Enterprise cluster's FQDN: |
| 30 | + |
| 31 | + {{< note >}} |
| 32 | + |
| 33 | +We recommend running Prometheus in Docker only for development and testing. |
| 34 | + |
| 35 | + {{< /note >}} |
| 36 | + |
| 37 | + ```yml |
| 38 | + global: |
| 39 | + scrape_interval: 15s |
| 40 | + evaluation_interval: 15s |
| 41 | + |
| 42 | + # Attach these labels to any time series or alerts when communicating with |
| 43 | + # external systems (federation, remote storage, Alertmanager). |
| 44 | + external_labels: |
| 45 | + monitor: "prometheus-stack-monitor" |
| 46 | + |
| 47 | + # Load and evaluate rules in this file every 'evaluation_interval' seconds. |
| 48 | + #rule_files: |
| 49 | + # - "first.rules" |
| 50 | + # - "second.rules" |
| 51 | + |
| 52 | + scrape_configs: |
| 53 | + # scrape Prometheus itself |
| 54 | + - job_name: prometheus |
| 55 | + scrape_interval: 10s |
| 56 | + scrape_timeout: 5s |
| 57 | + static_configs: |
| 58 | + - targets: ["localhost:9090"] |
| 59 | + |
| 60 | + # scrape Redis Enterprise |
| 61 | + - job_name: redis-enterprise |
| 62 | + scrape_interval: 30s |
| 63 | + scrape_timeout: 30s |
| 64 | + metrics_path: / # For v2, use /v2 |
| 65 | + scheme: https |
| 66 | + tls_config: |
| 67 | + insecure_skip_verify: true |
| 68 | + static_configs: |
| 69 | + - targets: ["<cluster_name>:8070"] |
| 70 | + ``` |
| 71 | + |
| 72 | +1. Set up your Prometheus and Grafana servers. |
| 73 | + To set up Prometheus and Grafana on Docker: |
| 74 | + 1. Create a _docker-compose.yml_ file: |
| 75 | + |
| 76 | + ```yml |
| 77 | + version: '3' |
| 78 | + services: |
| 79 | + prometheus-server: |
| 80 | + image: prom/prometheus |
| 81 | + ports: |
| 82 | + - 9090:9090 |
| 83 | + volumes: |
| 84 | + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml |
| 85 | + |
| 86 | + grafana-ui: |
| 87 | + image: grafana/grafana |
| 88 | + ports: |
| 89 | + - 3000:3000 |
| 90 | + environment: |
| 91 | + - GF_SECURITY_ADMIN_PASSWORD=secret |
| 92 | + links: |
| 93 | + - prometheus-server:prometheus |
| 94 | + ``` |
| 95 | +
|
| 96 | + 1. To start the containers, run: |
| 97 | +
|
| 98 | + ```sh |
| 99 | + $ docker compose up -d |
| 100 | + ``` |
| 101 | + |
| 102 | + 1. To check that all of the containers are up, run: `docker ps` |
| 103 | + 1. In your browser, sign in to Prometheus at http://localhost:9090 to make sure the server is running. |
| 104 | + 1. Select **Status** and then **Targets** to check that Prometheus is collecting data from your Redis Enterprise cluster. |
| 105 | + |
| 106 | + {{<image filename="images/rs/prometheus-target.png" alt="The Redis Enterprise target showing that Prometheus is connected to the Redis Enterprise Cluster.">}} |
| 107 | + |
| 108 | + 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. |
| 109 | + |
| 110 | +1. Configure the Grafana datasource: |
| 111 | + 1. Sign in to Grafana. If you installed Grafana locally, go to http://localhost:3000 and sign in with: |
| 112 | + |
| 113 | + - Username: admin |
| 114 | + - Password: secret |
| 115 | + |
| 116 | + 1. In the Grafana configuration menu, select **Data Sources**. |
| 117 | + |
| 118 | + 1. Select **Add data source**. |
| 119 | + |
| 120 | + 1. Select **Prometheus** from the list of data source types. |
| 121 | + |
| 122 | + {{<image filename="images/rs/prometheus-datasource.png" alt="The Prometheus data source in the list of data sources on Grafana.">}} |
| 123 | + |
| 124 | + 1. Enter the Prometheus configuration information: |
| 125 | + |
| 126 | + - Name: `redis-enterprise` |
| 127 | + - URL: `http://<your prometheus server name>:9090` |
| 128 | + |
| 129 | + {{<image filename="images/rs/prometheus-connection.png" alt="The Prometheus connection form in Grafana.">}} |
| 130 | + |
| 131 | + {{< note >}} |
| 132 | + |
| 133 | +- If the network port is not accessible to the Grafana server, select the **Browser** option from the Access menu. |
| 134 | +- In a testing environment, you can select **Skip TLS verification**. |
| 135 | + |
| 136 | + {{< /note >}} |
| 137 | + |
| 138 | +1. Add dashboards for cluster, database, node, and shard metrics. |
| 139 | + To add preconfigured dashboards: |
| 140 | + 1. In the Grafana dashboards menu, select **Manage**. |
| 141 | + 1. Click **Import**. |
| 142 | + 1. Upload one or more [Grafana dashboards](#grafana-dashboards-for-redis-enterprise). |
| 143 | + |
| 144 | +### Grafana dashboards for Redis Enterprise |
| 145 | + |
| 146 | +Redis publishes four preconfigured dashboards for Redis Enterprise and Grafana: |
| 147 | + |
| 148 | +* The [cluster status dashboard](https://grafana.com/grafana/dashboards/18405-cluster-status-dashboard/) provides an overview of your Redis Enterprise clusters. |
| 149 | +* The [database status dashboard](https://grafana.com/grafana/dashboards/18408-database-status-dashboard/) displays specific database metrics, including latency, memory usage, ops/second, and key count. |
| 150 | +* The [node metrics dashboard](https://github.com/redis-field-engineering/redis-enterprise-observability/blob/main/grafana/dashboards/grafana_v9-11/software/basic/redis-software-node-dashboard_v9-11.json) provides metrics for each of the nodes hosting your cluster. |
| 151 | +* The [shard metrics dashboard](https://github.com/redis-field-engineering/redis-enterprise-observability/blob/main/grafana/dashboards/grafana_v9-11/software/basic/redis-software-shard-dashboard_v9-11.json) displays metrics for the individual Redis processes running on your cluster nodes |
| 152 | +* The [Active-Active dashboard](https://github.com/redis-field-engineering/redis-enterprise-observability/blob/main/grafana/dashboards/grafana_v9-11/software/basic/redis-software-active-active-dashboard_v9-11.json) displays metrics specific to [Active-Active databases]({{< relref "/operate/rs/databases/active-active" >}}). |
| 153 | + |
| 154 | +These dashboards are open source. For additional dashboard options, or to file an issue, see the [Redis Enterprise observability Github repository](https://github.com/redis-field-engineering/redis-enterprise-observability/tree/main/grafana). |
| 155 | + |
| 156 | +For more information about configuring Grafana dashboards, see the [Grafana documentation](https://grafana.com/docs/). |
0 commit comments