Skip to content

Commit b656f09

Browse files
mohammedabdulwahhabrmccorm4
authored andcommitted
fix: fix metrics docs; add dcgm-exporter (#2712)
Signed-off-by: mohammedabdulwahhab <furkhan324@berkeley.edu> Co-authored-by: Ryan McCormick <rmccormick@nvidia.com> Signed-off-by: nnshah1 <neelays@nvidia.com>
1 parent d3edef9 commit b656f09

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

docs/guides/dynamo_deploy/k8s_metrics.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
## Overview
44

5-
This guide provides a walkthrough for collecting and visualizing metrics from Dynamo components using the Prometheus Operator stack. The Prometheus Operator provides a powerful and flexible way to configure monitoring for Kubernetes applications through custom resources like PodMonitors, making it easy to automatically discover and scrape metrics from Dynamo components.
5+
This guide provides a walkthrough for collecting and visualizing metrics from Dynamo components using the kube-prometheus-stack. The kube-prometheus-stack provides a powerful and flexible way to configure monitoring for Kubernetes applications through custom resources like PodMonitors, making it easy to automatically discover and scrape metrics from Dynamo components.
66

77
## Prerequisites
88

99
### Install Dynamo Operator
1010
Before setting up metrics collection, you'll need to have the Dynamo operator installed in your cluster. Follow our [Installation Guide](../dynamo_deploy/dynamo_cloud.md) for detailed instructions on deploying the Dynamo operator.
1111

12-
### Install Prometheus Operator
13-
If you don't have an existing Prometheus setup, you'll need to install the Prometheus Operator. The Prometheus Operator introduces custom resources that make it easy to deploy and manage Prometheus monitoring in Kubernetes:
12+
### Install kube-prometheus-stack
13+
If you don't have an existing Prometheus setup, you'll likely want to install the kube-prometheus-stack. This is a collection of Kubernetes manifests that includes the Prometheus Operator, Prometheus, Grafana, and other monitoring components in a pre-configured setup. The stack introduces custom resources that make it easy to deploy and manage monitoring in Kubernetes:
1414

1515
- `PodMonitor`: Automatically discovers and scrapes metrics from pods based on label selectors
1616
- `ServiceMonitor`: Similar to PodMonitor but works with Services
@@ -20,9 +20,27 @@ For a basic installation:
2020
```bash
2121
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
2222
helm repo update
23-
helm install prometheus prometheus-community/kube-prometheus-stack
23+
# Values allow podmnonitors to be picked up that are outside of the kube-prometheus-stack helm release
24+
helm install prometheus prometheus-community/kube-prometheus-stack \
25+
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=false \
26+
--set prometheus.prometheusSpec.podMonitorNamespaceSelector="{}" \
27+
--set prometheus.prometheusSpec.probeNamespaceSelector="{}"
2428
```
2529

30+
> [!Note]
31+
> The commands enumerated below assume you have installed the kube-prometheus-stack with the installation method listed above. Depending on your installation configuration of the monitoring stack, you may need to modify the `kubectl` commands that follow in this document accordingly (e.g modifying Namespace or Service names accordingly).
32+
33+
### DCGM Metrics Collection (Optional)
34+
35+
GPU utilization metrics are collected and exported to Prometheus via dcgm-exporter. The Dynamo Grafana dashboard includes a panel for GPU utilization related to your Dynamo deployment. For that panel to be populated, you need to ensure that the dcgm-exporter is running in your cluster. To check if the dcgm-exporter is running, please run the following command:
36+
37+
```bash
38+
kubectl get daemonset -A | grep dcgm-exporter
39+
```
40+
41+
If the output is empty, you need to install the dcgm-exporter. For more information, please consult the official [dcgm-exporter documentation](https://docs.nvidia.com/datacenter/cloud-native/gpu-telemetry/latest/dcgm-exporter.html).
42+
43+
2644
## Deploy a DynamoGraphDeployment
2745

2846
Let's start by deploying a simple vLLM aggregated deployment:
@@ -178,13 +196,13 @@ The dashboard is embedded in the ConfigMap. Since it is labeled with `grafana_da
178196
- Inter-token latency
179197
- Request duration
180198
- Input/Output sequence lengths
181-
- GPU utilization
199+
- GPU utilization via DCGM
182200

183201
## Viewing the Metrics
184202

185203
### In Prometheus
186204
```bash
187-
kubectl port-forward svc/prometheus-operated 9090:9090 -n monitoring
205+
kubectl port-forward svc/prometheus-kube-prometheus-prometheus 9090:9090 -n monitoring
188206
```
189207

190208
Visit http://localhost:9090 and try these example queries:
@@ -195,9 +213,18 @@ Visit http://localhost:9090 and try these example queries:
195213

196214
### In Grafana
197215
```bash
198-
kubectl port-forward svc/grafana 3000:80 -n monitoring
216+
# Get Grafana credentials
217+
export GRAFANA_USER=$(kubectl get secret -n monitoring prometheus-grafana -o jsonpath="{.data.admin-user}" | base64 --decode)
218+
export GRAFANA_PASSWORD=$(kubectl get secret -n monitoring prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 --decode)
219+
echo "Grafana user: $GRAFANA_USER"
220+
echo "Grafana password: $GRAFANA_PASSWORD"
221+
222+
# Port forward Grafana service
223+
kubectl port-forward svc/prometheus-grafana 3000:80 -n monitoring
199224
```
200225

201-
Visit http://localhost:3000 and find the Dynamo dashboard under General.
226+
Visit http://localhost:3000 and log in with the credentials captured above.
227+
228+
Once logged in, find the Dynamo dashboard under General.
202229

203230
![Grafana dashboard showing Dynamo metrics](../../images/grafana-k8s.png)

0 commit comments

Comments
 (0)