Skip to content

Commit

Permalink
helm: Add tetragon_pod label to metrics in ServiceMonitor
Browse files Browse the repository at this point in the history
Prometheus Operator by default adds "pod" label, representing the metrics
exporter pod, to all scraped metrics. However, Tetragon exposes events metrics
with "pod" label, which represents the process that generated events, not
Tetragon pod. This label is not overridden if using the default ServiceMonitor
(with "honorLabels: true") - that's good. However, it still can be useful to
know which Tetragon pod exported the metric. Let's add "tetragon_pod" label to
metrics scraped via default ServiceMonitor.

Signed-off-by: Anna Kapuscinska <[email protected]>
  • Loading branch information
lambdanis committed Aug 23, 2024
1 parent a08b42e commit 340c6b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions install/kubernetes/tetragon/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ spec:
sourceLabels:
- __meta_kubernetes_pod_node_name
targetLabel: node
- replacement: ${1}
sourceLabels:
- __meta_kubernetes_pod_name
targetLabel: tetragon_pod
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
Expand Down

0 comments on commit 340c6b0

Please sign in to comment.