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 ee8a108
Showing 1 changed file with 3 additions and 0 deletions.
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 ee8a108

Please sign in to comment.