Skip to content

Commit 1627b9d

Browse files
kfswainEyalPazz
authored andcommitted
Adding pprof endpoints to metrics port (kubernetes-sigs#1069)
1 parent e8abc04 commit 1627b9d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cmd/epp/runner/runner.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"flag"
2222
"fmt"
2323
"net/http/pprof"
24-
"os"
2524

2625
"github.com/go-logr/logr"
2726
"github.com/prometheus/client_golang/prometheus"

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ We currently have 2 types of prometheus deployments documented:
172172
Please follow [grafana instructions](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/import-dashboards/) to load the dashboard json.
173173
The dashboard can be found here [Grafana Dashboard](https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/tools/dashboards/inference_gateway.json)
174174

175+
### Pprof profiles
176+
177+
Currently only the [predefined profiles](https://pkg.go.dev/runtime/pprof#Profile) are supported, CPU profiling will require code changes. Assuming the EPP has been port-forwarded as in the above example, to get the PGN display of the `heap` profile simply run:
178+
179+
```
180+
PROFILE_NAME=heap
181+
curl -H "Authorization: Bearer $TOKEN" localhost:9090/debug/pprof/$PROFILE_NAME -o profile.out
182+
go tool pprof -png profile.out
183+
```
184+
175185
## Prometheus Alerts
176186

177187
The section instructs how to configure prometheus alerts using collected metrics.

0 commit comments

Comments
 (0)