From 16d47d18c05d3ea5695cacc08e36f8725f913bc7 Mon Sep 17 00:00:00 2001 From: Christian Simon Date: Tue, 10 Dec 2024 13:49:38 +0000 Subject: [PATCH] feat(grafana): Introduce profiling container port 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 https://github.com/grafana/pyroscope/pull/3753 Signed-off-by: Christian Simon --- charts/grafana/Chart.yaml | 2 +- charts/grafana/templates/_pod.tpl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/grafana/Chart.yaml b/charts/grafana/Chart.yaml index f8ff539e08..c8e6e9d123 100644 --- a/charts/grafana/Chart.yaml +++ b/charts/grafana/Chart.yaml @@ -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. diff --git a/charts/grafana/templates/_pod.tpl b/charts/grafana/templates/_pod.tpl index bf55e43ba7..a0c32cf7aa 100644 --- a/charts/grafana/templates/_pod.tpl +++ b/charts/grafana/templates/_pod.tpl @@ -1088,6 +1088,9 @@ containers: - name: {{ .Values.gossipPortName }}-udp containerPort: 9094 protocol: UDP + - name: profiling + containerPort: 6060 + protocol: TCP env: - name: POD_IP valueFrom: