Skip to content

Commit 5cd303e

Browse files
authored
Merge pull request #55 from redis-field-engineering/dynatrace-k8s
FIELDENG-751 Explainer for using K8s with Dynatrace
2 parents d8bbc6b + 11fd066 commit 5cd303e

File tree

2 files changed

+232
-1
lines changed

2 files changed

+232
-1
lines changed

dynatrace/README.adoc

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,130 @@ To collect metrics in Dynatrace from Redis Enterprise Software or Redis Cloud, u
1616

1717
== Installation
1818

19-
The Dyntrace v2.0 Extensions support Prometheus metrics, and as such we have created the necessary extension file and dashboards so that this option is available. At this time Dynatrace are still testing their signing mechanism so that this extension is not available directly from them, but will have to be built and signed according to their instructions. They have indicated that they will sign 3rd party extensions starting in Q1 2024, at which point this process will no longer be necessary.
19+
The Dynatrace v2.0 Extensions support Prometheus metrics, and as such we have created the necessary extension file and dashboards so that this option is available. At this time Dynatrace are still testing their signing mechanism so that this extension is not available directly from them, but will have to be built and signed according to their instructions. They have indicated that they will sign 3rd party extensions starting in Q1 2024, at which point this process will no longer be necessary.
2020

2121
Clone the repository and cd into its root folder ('redis-enterprise-dynatrace-observability'). The contents are already in the required format; a 'src' directory containing a .yml file and a folder containing .json dashboard files.
2222

2323
Follow the instructions here:
2424

2525
https://www.dynatrace.com/support/help/extend-dynatrace/extensions20/sign-extension
2626

27+
=== Kubernetes Deployments
28+
29+
**Important:** The Dynatrace Kubernetes operator is not compatible with the Extensions V2 framework. If you're running Redis Enterprise in Kubernetes, you have two alternative options:
30+
31+
==== Option 1: Kubernetes Service with Dynatrace Annotations
32+
33+
This approach creates a new service within your Kubernetes cluster with Dynatrace annotations for Prometheus scraping.
34+
35+
===== Prerequisites
36+
* Dynatrace Kubernetes operator installed in your cluster
37+
* Prometheus scraping enabled in Dynatrace Kubernetes settings
38+
39+
===== Steps
40+
41+
1. **Install Dynatrace Operator**
42+
+
43+
Follow the official Dynatrace operator installation guide:
44+
+
45+
[source,bash]
46+
----
47+
# Install Dynatrace operator according to Dynatrace documentation
48+
kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/latest/download/kubernetes.yaml
49+
----
50+
51+
2. **Enable Prometheus Scraping in Dynatrace**
52+
+
53+
Configure Prometheus metric ingestion in your Dynatrace Kubernetes settings according to the official documentation:
54+
https://docs.dynatrace.com/docs/observe/infrastructure-monitoring/container-platform-monitoring/kubernetes-monitoring/monitor-prometheus-metrics
55+
56+
3. **Create Annotated Service for Redis Metrics**
57+
+
58+
Apply the following service configuration:
59+
+
60+
[source,yaml]
61+
----
62+
apiVersion: v1
63+
kind: Service
64+
metadata:
65+
name: redis-metrics
66+
namespace: redis-enterprise
67+
annotations:
68+
metrics.dynatrace.com/scrape: "true"
69+
metrics.dynatrace.com/port: "8070"
70+
metrics.dynatrace.com/path: "/metrics"
71+
metrics.dynatrace.com/secure: "true"
72+
metrics.dynatrace.com/insecure_skip_verify: "true"
73+
spec:
74+
type: ClusterIP
75+
selector:
76+
app: redis-enterprise
77+
redis.io/role: node
78+
redis.io/cluster: redis-enterprise-cluster # or whatever REC name in use
79+
redis.io/role-master: "1" # Point only at master node
80+
81+
ports:
82+
- name: metrics
83+
port: 8070
84+
targetPort: 8070
85+
----
86+
87+
4. **Verify Metrics Collection**
88+
+
89+
Check that Dynatrace is successfully scraping metrics from your Redis Enterprise deployment through the Kubernetes operator.
90+
91+
==== Option 2: External VM with ActiveGate
92+
93+
This approach involves deploying ActiveGate on a VM outside your Kubernetes cluster and exposing the Redis Enterprise metrics endpoint.
94+
95+
===== Prerequisites
96+
* A VM outside your Kubernetes cluster with network access to the cluster
97+
* ActiveGate installed on the VM
98+
* Network connectivity between the ActiveGate VM and your Kubernetes cluster
99+
100+
===== Steps
101+
102+
1. **Deploy ActiveGate on External VM**
103+
+
104+
Follow the standard ActiveGate installation process on your VM:
105+
+
106+
[source,bash]
107+
----
108+
# Download and install ActiveGate according to Dynatrace documentation
109+
# https://docs.dynatrace.com/docs/ingest-from/dynatrace-activegate/installation
110+
----
111+
112+
2. **Expose Redis Enterprise Metrics Service**
113+
+
114+
Create a NodePort service to expose the redis-enterprise-cluster-prom service:
115+
+
116+
[source,yaml]
117+
----
118+
apiVersion: v1
119+
kind: Service
120+
metadata:
121+
name: redis-metrics-external
122+
namespace: redis-enterprise
123+
spec:
124+
type: NodePort
125+
selector:
126+
app: redis-enterprise
127+
redis.io/role-master: "1"
128+
ports:
129+
- name: metrics
130+
port: 8070
131+
targetPort: 8070
132+
nodePort: 30070 # Choose an available port in the NodePort range
133+
----
134+
135+
3. **Configure ActiveGate**
136+
+
137+
Configure your ActiveGate to scrape metrics from the exposed NodePort service using the external IP of your Kubernetes nodes and the NodePort (e.g., `https://KUBERNETES_NODE_IP:30070/metrics`).
138+
139+
4. **Setup Extension**
140+
+
141+
Follow the standard extension setup process using the External VM's ActiveGate.
142+
27143
== Dashboards
28144

29145
This respository includes sample Dynatrace dashboards for monitoring your Redis deplyoment. See the link:/dynatrace/dashboards[dashboards] folder for the available set of dashboards.

dynatrace_v2/README.adoc

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,121 @@ sudo systemctl restart dynatracegateway
9898

9999
If you have an Active-Active Redis Enterprise deployment in GCP, you can use our Terraform scripts to automate the entire process. See the `terraform/gcp` directory for configuration details.
100100

101+
=== Kubernetes Deployments
102+
103+
**Important:** The Dynatrace Kubernetes operator is not compatible with the Extensions V2 framework. If you're running Redis Enterprise in Kubernetes, you have two alternative options:
104+
105+
==== Option 1: Kubernetes Service with Dynatrace Annotations
106+
107+
This approach creates a new service within your Kubernetes cluster with Dynatrace annotations for Prometheus scraping.
108+
109+
===== Prerequisites
110+
* Dynatrace Kubernetes operator installed in your cluster
111+
* Prometheus scraping enabled in Dynatrace Kubernetes settings
112+
113+
===== Steps
114+
115+
1. **Install Dynatrace Operator**
116+
+
117+
Follow the official Dynatrace operator installation guide:
118+
+
119+
[source,bash]
120+
----
121+
# Install Dynatrace operator according to Dynatrace documentation
122+
kubectl apply -f https://github.com/Dynatrace/dynatrace-operator/releases/latest/download/kubernetes.yaml
123+
----
124+
125+
2. **Enable Prometheus Scraping in Dynatrace**
126+
+
127+
Configure Prometheus metric ingestion in your Dynatrace Kubernetes settings according to the official documentation:
128+
https://docs.dynatrace.com/docs/observe/infrastructure-monitoring/container-platform-monitoring/kubernetes-monitoring/monitor-prometheus-metrics
129+
130+
3. **Create Annotated Service for Redis Metrics**
131+
+
132+
Apply the following service configuration:
133+
+
134+
[source,yaml]
135+
----
136+
apiVersion: v1
137+
kind: Service
138+
metadata:
139+
name: redis-metrics
140+
namespace: redis-enterprise
141+
annotations:
142+
metrics.dynatrace.com/scrape: "true"
143+
metrics.dynatrace.com/port: "8070"
144+
metrics.dynatrace.com/path: "/v2"
145+
metrics.dynatrace.com/secure: "true"
146+
metrics.dynatrace.com/insecure_skip_verify: "true"
147+
spec:
148+
type: ClusterIP
149+
selector:
150+
app: redis-enterprise
151+
redis.io/role: node
152+
redis.io/cluster: redis-enterprise-cluster # or whatever REC name in use
153+
redis.io/role-master: "1" # Point only at master node
154+
ports:
155+
- name: metrics
156+
port: 8070
157+
targetPort: 8070
158+
----
159+
160+
4. **Verify Metrics Collection**
161+
+
162+
Check that Dynatrace is successfully scraping metrics from your Redis Enterprise deployment through the Kubernetes operator.
163+
164+
==== Option 2: External VM with ActiveGate
165+
166+
This approach involves deploying ActiveGate on a VM outside your Kubernetes cluster and exposing the Redis Enterprise metrics endpoint.
167+
168+
===== Prerequisites
169+
* A VM outside your Kubernetes cluster with network access to the cluster
170+
* ActiveGate installed on the VM
171+
* Network connectivity between the ActiveGate VM and your Kubernetes cluster
172+
173+
===== Steps
174+
175+
1. **Deploy ActiveGate on External VM**
176+
+
177+
Follow the standard ActiveGate installation process on your VM:
178+
+
179+
[source,bash]
180+
----
181+
# Download and install ActiveGate according to Dynatrace documentation
182+
# https://docs.dynatrace.com/docs/ingest-from/dynatrace-activegate/installation
183+
----
184+
185+
2. **Expose Redis Enterprise Metrics Service**
186+
+
187+
Create a NodePort service to expose the redis-enterprise-cluster-prom service:
188+
+
189+
[source,yaml]
190+
----
191+
apiVersion: v1
192+
kind: Service
193+
metadata:
194+
name: redis-metrics-external
195+
namespace: redis-enterprise
196+
spec:
197+
type: NodePort
198+
selector:
199+
app: redis-enterprise
200+
redis.io/role-master: "1"
201+
ports:
202+
- name: metrics
203+
port: 8070
204+
targetPort: 8070
205+
nodePort: 30070 # Choose an available port in the NodePort range
206+
----
207+
208+
3. **Configure ActiveGate**
209+
+
210+
Configure your ActiveGate to scrape metrics from the exposed NodePort service using the external IP of your Kubernetes nodes and the NodePort (e.g., `https://KUBERNETES_NODE_IP:30070/v2`).
211+
212+
4. **Setup Extension**
213+
+
214+
Follow the standard extension setup process using the External VM's ActiveGate.
215+
101216
== Dashboards
102217

103218
This repository includes sample Dynatrace dashboards for monitoring your Redis deployment. See the

0 commit comments

Comments
 (0)