Skip to content

Commit

Permalink
feat(grafana): Introduce profiling container port
Browse files Browse the repository at this point in the history
In order to enable profiling using Grafana Alloy and Grafana Pyroscope
currently you would need to abuse another container port or insert a
dummy container to facitilitate profile collection.

This is because a containerPort is matched with the annotations to
enable profiling. As a workaround I am "abusing" the port :9094, as for
the example I am working on it is unused. This change will make it
possible to coexist with gossip-tcp and you would be able to enable
profiling like this:

```
helm upgrade -n pyroscope-test --install grafana grafana/grafana \
  --set env.GF_DIAGNOSTICS_PROFILING_ENABLED=true \
  --set env.GF_DIAGNOSTICS_PROFILING_ADDR=0.0.0.0 \
  --set env.GF_DIAGNOSTICS_PROFILING_PORT=6060 \
  --set-string 'podAnnotations.profiles\.grafana\.com/cpu\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/cpu\.port=6060' \
  --set-string 'podAnnotations.profiles\.grafana\.com/memory\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/memory\.port=6060' \
  --set-string 'podAnnotations.profiles\.grafana\.com/goroutine\.scrape=true' \
  --set-string 'podAnnotations.profiles\.grafana\.com/goroutine\.port=6060'
```

This is realted to grafana/pyroscope#3753

Signed-off-by: Christian Simon <[email protected]>
  • Loading branch information
simonswine committed Dec 10, 2024
1 parent 897c250 commit 16d47d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: grafana
version: 8.6.4
version: 8.6.5
appVersion: 11.3.1
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
3 changes: 3 additions & 0 deletions charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,9 @@ containers:
- name: {{ .Values.gossipPortName }}-udp
containerPort: 9094
protocol: UDP
- name: profiling
containerPort: 6060
protocol: TCP
env:
- name: POD_IP
valueFrom:
Expand Down

0 comments on commit 16d47d1

Please sign in to comment.