|
| 1 | +:linkattrs: |
| 2 | +:project-owner: redis-field-engineering |
| 3 | +:project-name: redis-enterprise-observability |
| 4 | +:name: Redis Enterprise New Relic Prometheus Exporter |
| 5 | + |
| 6 | += Redis Enterprise New Relic Prometheus Exporter |
| 7 | + |
| 8 | +This repository contains a set of New Relic dashboards configured to display Redis Enterprise v2 metrics exported through |
| 9 | +Prometheus. For more details about the two versions as well as a guide to migrating between please see the following |
| 10 | +link and, more specifically, its subsections: https://redis.io/docs/latest/integrate/prometheus-with-redis-enterprise/[Prometheus with Redis Enterprise] |
| 11 | + |
| 12 | +== Table of Contents |
| 13 | + |
| 14 | +* link:#Requirements[Requirements] |
| 15 | +* link:#Usage[Usage] |
| 16 | +* link:#Dashboards[Dashboards] |
| 17 | +* link:#Support[Support] |
| 18 | +* link:#License[License] |
| 19 | + |
| 20 | +== Requirements |
| 21 | + |
| 22 | +To use this project, you will need: |
| 23 | + |
| 24 | +* A https://docs.redis.com/latest/rs/[Redis Enterprise] deployment or a https://docs.redis.com/latest/rc/[Redis Cloud] |
| 25 | +account with a https://docs.redis.com/latest/rc/subscriptions/create-flexible-subscription/[Flexible or Annual subscription] |
| 26 | +* A https://newrelic.com/[New Relic account] |
| 27 | +* A Prometheus deployment. You can run Prometheus in a container using the provided Dockerfile, or you can configure an |
| 28 | +existing Prometheus by referencing the included link:/prometheus.yml[prometheus.yml]. |
| 29 | + |
| 30 | +=== Redis Enterprise Software |
| 31 | + |
| 32 | +To monitor a Redis Enterprise Software deployment, you will need your cluster"s FQDN or hostname. The Prometheus |
| 33 | +endpoint is available on port 8070. |
| 34 | + |
| 35 | +=== Redis Enterprise Cloud |
| 36 | + |
| 37 | +To monitor a Redis Cloud deployment, you will need the |
| 38 | +https://docs.redis.com/latest/rc/databases/view-edit-database/[private endpoint] for one of the databases associated |
| 39 | +with your Redis Cloud subscription. |
| 40 | + |
| 41 | +This private endpoint will have the following form: |
| 42 | + |
| 43 | +`redis-12345.internal.c67890.us-central1-1.gcp.cloud.rlrcp.com:121212`. |
| 44 | + |
| 45 | +To get the Prometheus endpoint for your Redis Cloud subscription, drop the section before the first dot (in this case, |
| 46 | +the "redis-12345"), and specify the Prometheus exporter port 8070: |
| 47 | + |
| 48 | +`internal.c67890.us-central1-1.gcp.cloud.rlrcp.com:8070` |
| 49 | + |
| 50 | +This is the endpoint that you will provide when you configure Prometheus. |
| 51 | + |
| 52 | +== Usage |
| 53 | + |
| 54 | +=== Configure Prometheus |
| 55 | + |
| 56 | +From New Relic UI, find the left-hand menu and click "Add Data". |
| 57 | + |
| 58 | +Type "Prometheus" in the search bar and then select "Prometheus Remote Write Integration". |
| 59 | + |
| 60 | +Enter a name for the installation (e.g., "redis-server-prod") and click "generate". This will generate a remote write |
| 61 | +configuration with a bearer token. |
| 62 | + |
| 63 | +Open the sample link:./config/prometheus.yml[prometheus.yml] file and find the "remote_write" configuration directive. |
| 64 | + |
| 65 | +Under "url", replace "REDIS_ENTERPRISE_SERVER_NAME" with the installation name you just provided when generating your |
| 66 | +token (e.g., "redis-server-prod"). |
| 67 | + |
| 68 | +Next, find the "remote_write" -> "authorization" -> "credentials" configuration directive. |
| 69 | +Replace NEW_RELIC_BEARER_TOKEN with the value of the bearer token you just generated. |
| 70 | + |
| 71 | +Finally, find the "scrape_config" configuration directive where "job_name" is "redis-enterprise". |
| 72 | +Under "static_configs", replace REDIS_ENTERPRISE_HOST with the FQDN or hostname of your Redis Enterprise deployment. |
| 73 | + |
| 74 | +=== Run a Prometheus Server using Docker |
| 75 | + |
| 76 | +If you don't already have a Prometheus server, you can run Prometheus using a Docker container. This container will |
| 77 | +forward Prometheus metrics from Redis Enterprise to New Relic. |
| 78 | + |
| 79 | +For Redis Enterprise Cloud deployments, ensure that the VM running your Prometheus container is |
| 80 | +https://docs.redis.com/latest/rc/security/vpc-peering/:[VPC-peered with your Redis cluster"s VPC]. |
| 81 | + |
| 82 | +Next, use the included link:/Dockerfile[Dockerfile] to create a container image. |
| 83 | + |
| 84 | +Build and tag the image: |
| 85 | + |
| 86 | +[source,bash] |
| 87 | +docker build -t new-relic-redis-cloud-prometheus . |
| 88 | + |
| 89 | +Then run the image you just created: |
| 90 | + |
| 91 | +[source,bash] |
| 92 | +docker run \ |
| 93 | + -d \ |
| 94 | + --name prometheus-exporter \ |
| 95 | + --network=host \ |
| 96 | + --cap-add=SYS_PTRACE \ |
| 97 | + --privileged \ |
| 98 | + --pid=host \ |
| 99 | + --cgroupns=host |
| 100 | + new-relic-redis-cloud-prometheus |
| 101 | + |
| 102 | +Now you can test that metrics are flowing correctly to New Relic. |
| 103 | + |
| 104 | +Once the container has been running for five minutes, open the New Relic UI and click "Query Your Data" in the left-hand |
| 105 | +menu. In the "Metric" search bar, enter "bdb_up", which should then appear in the results. You can then click to launch a |
| 106 | +https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-new-relics-query-language/[NRQL query], |
| 107 | +and this will return a value corresponding to the number of databases. |
| 108 | + |
| 109 | +== Dashboards |
| 110 | + |
| 111 | +This project includes sample New Relic dashboards that you can install to get you up and running quickly. |
| 112 | +See the link:https://github.com/redis-field-engineering/redis-enterprise-observability/tree/main/newrelic/dashboards[dashboards] folder. |
| 113 | + |
| 114 | +To install the dashboards in the New Relic console, click on the ""Dashboards"" link in the left menu, |
| 115 | +and then click "Import Dashboard" in the top right. Open the dashboard that you wish to import in a text editor. |
| 116 | +Copy the accountId from the New Relic URL after logging in, it looks like this: |
| 117 | +`one.newrelic.com/dashboards?account=<#>&state` |
| 118 | +And replace all occurrences of '1234567' in the dashboard file with this value. Then paste the contents of the JSON file |
| 119 | +into the import text area. |
| 120 | + |
| 121 | +Once you've installed the dashboards, open the Cluster Dashboard and select a cluster using the "cluster" dropdown menu. |
| 122 | +If data is flowing correctly, you will see a set of charts with active data. If you cannot see any data, ensure that |
| 123 | +the time range for the dashboards is set to the last 10 minutes (you can find this setting at the upper right-hand |
| 124 | +corner of the UI). |
| 125 | + |
| 126 | +== Support |
| 127 | + |
| 128 | +This project is supported by Redis, Inc. on a good faith effort basis. To report bugs, request features, or receive |
| 129 | +assistance, please https://github.com/{project-owner}/{project-name}/issues[file an issue]. |
| 130 | + |
| 131 | +== License |
| 132 | + |
| 133 | +This code in this repository is licensed under the MIT License. Copyright (C) 2025 Redis, Inc. |
0 commit comments