Skip to content

Commit eb6ab1e

Browse files
committed
docs: add prometheus + grafana deployment guide
1 parent 916bc59 commit eb6ab1e

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
serviceAccounts:
2+
server:
3+
create: false
4+
name: inference-gateway-sa-metrics-reader
5+
6+
extraScrapeConfigs: |
7+
- job_name: 'inference-extension-epp'
8+
authorization:
9+
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
10+
scrape_interval: 5s
11+
kubernetes_sd_configs:
12+
- role: endpoints
13+
relabel_configs:
14+
- source_labels: [__meta_kubernetes_service_name]
15+
action: keep
16+
regex: .*-epp$
17+
- source_labels: [__meta_kubernetes_pod_container_port_number]
18+
action: keep
19+
regex: "9090"
20+
- job_name: vllm
21+
scrape_interval: 5s
22+
kubernetes_sd_configs:
23+
- role: pod
24+
relabel_configs:
25+
- source_labels: [__meta_kubernetes_pod_label_app]
26+
action: keep
27+
regex: vllm-llama3-8b-instruct

site-src/guides/metrics-and-observability.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,60 @@ PROFILE_NAME=heap
126126
curl -H "Authorization: Bearer $TOKEN" localhost:9090/debug/pprof/$PROFILE_NAME -o profile.out
127127
go tool pprof -png profile.out
128128
```
129+
## Setting Up Grafana + Prometheus
130+
131+
### Grafana
132+
133+
A simple grafana deployment can be done with the following commands:
134+
135+
```bash
136+
helm repo add grafana https://grafana.github.io/helm-charts
137+
helm install grafana grafana/grafana --namespace monitoring --create-namespace
138+
```
139+
140+
Get the Grafana URL to visit by running these commands in the same shell:
141+
142+
```bash
143+
export POD_NAME=$(kubectl get pods --namespace monitoring -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}")
144+
kubectl --namespace monitoring port-forward $POD_NAME 3000
145+
```
146+
147+
### Prometheus
148+
149+
We currently have 2 types of prometheus deployments documented:
150+
151+
1. Self Hosted using the prometheus helm chart
152+
2. Using Google Managed Prometheus
153+
154+
=== "Self-Hosted"
155+
156+
Add the prometheus-community helm repository:
157+
158+
```bash
159+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
160+
```
161+
162+
Deploy the prometheus helm chart using this command:
163+
```bash
164+
helm install prometheus prometheus-community/prometheus \
165+
--namespace monitoring \
166+
-f https://github.com/kubernetes-sigs/gateway-api-inference-extension/raw/main/config/manifests/prometheus/values.yaml
167+
```
168+
169+
You can add the prometheus data source to grafana following [This Guide](https://grafana.com/docs/grafana/latest/administration/data-source-management/).
170+
The prometheus server host is by default `http://prometheus-server`
171+
172+
Notice that the given values file is very simple and will work directly after following the [Getting Started Guide](https://gateway-api-inference-extension.sigs.k8s.io/guides/), you might need to modify it
173+
174+
=== "Google Managed"
175+
176+
If you run the inference gateway with [Google Managed Prometheus](https://cloud.google.com/stackdriver/docs/managed-prometheus), please follow the [instructions](https://cloud.google.com/stackdriver/docs/managed-prometheus/query)
177+
to configure Google Managed Prometheus as data source for the grafana dashboard.
178+
179+
## Load Inference Extension dashboard into Grafana
180+
181+
Please follow [grafana instructions](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/import-dashboards/) to load the dashboard json.
182+
The dashboard can be found here [Grafana Dashboard](https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/tools/dashboards/inference_gateway.json)
129183

130184
## Prometheus Alerts
131185

0 commit comments

Comments
 (0)