Skip to content

Commit d9a9bfc

Browse files
authored
Merge pull request #24 from redis-field-engineering/newrelic_v2
newrelic v2 dashboards, README and prometheus.yml
2 parents cf99fdb + c693274 commit d9a9bfc

10 files changed

+3026
-0
lines changed

newrelic_v2/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM ubuntu/prometheus:latest
2+
ADD config/prometheus.yml /etc/prometheus/prometheus.yml

newrelic_v2/README.adoc

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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.

newrelic_v2/config/prometheus.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Prometheus configuration for monitoring Redis Enterprise (Software/Cloud) with New Relic
2+
# Prometheus scrapes metrics from Redis Enterprise and forwards them to New Relic using Prometheus Remote Write (https://prometheus.io/docs/concepts/remote_write_spec/)
3+
# New Relic documents this strategy here: https://docs.newrelic.com/docs/infrastructure/prometheus-integrations/install-configure-remote-write/set-your-prometheus-remote-write-integration/
4+
#
5+
# Usage
6+
#
7+
# - Replace REDIS_ENTERPRISE_HOST with your cluster's hostname.
8+
# - Replace REDIS_ENTERPRISE_SERVICE NAME with any name you'd like to use to refer to this data source.
9+
# - Replace NEW_RELIC_BEARER_TOKEN with the token you generated in the New Relic UI.
10+
#
11+
# Configuration
12+
global:
13+
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
14+
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
15+
# scrape_timeout is set to the global default (10s).
16+
17+
# Alertmanager configuration
18+
alerting:
19+
alertmanagers:
20+
- static_configs:
21+
- targets:
22+
# - alertmanager:9093
23+
24+
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
25+
rule_files:
26+
# - "first_rules.yml"
27+
# - "second_rules.yml"
28+
29+
# Scrape configuration for Redis Enterprise and Prometheus
30+
scrape_configs:
31+
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
32+
- job_name: "prometheus"
33+
34+
# metrics_path defaults to '/metrics'
35+
# scheme defaults to 'http'.
36+
static_configs:
37+
- targets: ["localhost:9090"]
38+
39+
# Redis Enterprise
40+
- job_name: "redis-enterprise"
41+
scrape_interval: 30s
42+
scrape_timeout: 30s
43+
metrics_path: /v2
44+
scheme: https
45+
tls_config:
46+
insecure_skip_verify: true
47+
static_configs:
48+
# The default Redis Enterprise Prometheus port is 8070.
49+
# Replace REDIS_ENTERPRISE_HOST with your cluster's hostname.
50+
- targets: ["REDIS_ENTERPRISE_HOST:8070"]
51+
52+
# Remote write configuration for New Relic.
53+
# - Replace REDIS_ENTERPRISE_SERVICE NAME with any name you'd like to use to refer to this data source.
54+
# - Replace NEW_RELIC_BEARER_TOKEN with the token you generated in the New Relic UI.
55+
remote_write:
56+
- url: https://metric-api.newrelic.com/prometheus/v1/write?prometheus_server=REDIS_ENTERPRISE_SERVICE_NAME
57+
authorization:
58+
credentials: NEW_RELIC_BEARER_TOKEN

0 commit comments

Comments
 (0)