Skip to content

Commit 253f6f2

Browse files
Merge pull request #23 from Intreecom/feat/instrumentation-labels-and-annotations-support
Added support for instrumentation annotations and labels.
2 parents 653e6d7 + e81aa35 commit 253f6f2

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

charts/py-app/templates/deployment.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ spec:
2020
deployment_type: web
2121
template:
2222
metadata:
23-
{{- with .Values.podAnnotations }}
23+
{{- $podAnnotations := merge (deepCopy (default dict .Values.podAnnotations)) (default dict .Values.instrumentation.annotations) }}
24+
{{- with $podAnnotations }}
2425
annotations:
2526
{{- toYaml . | nindent 8 }}
2627
{{- end }}
28+
{{- $baseSelectorLabels := (include "py-app.selectorLabels" . | fromYaml) }}
29+
{{- $_ := set $baseSelectorLabels "deployment_type" "web" }}
30+
{{- $mergedLabels := merge $baseSelectorLabels (default dict .Values.instrumentation.labels) }}
2731
labels:
28-
{{- include "py-app.selectorLabels" . | nindent 8 }}
29-
deployment_type: web
32+
{{- toYaml $mergedLabels | nindent 8 }}
3033
spec:
3134
{{- with .Values.imagePullSecrets }}
3235
imagePullSecrets:

charts/py-app/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ replicaCount: 1
1313
# it will be put directly in containers.
1414
env: {}
1515

16+
# annotations and/or labels for zero-code instrumentation support (OpenTelemetry Collector and Grafana Beyla)
17+
instrumentation:
18+
annotations: {}
19+
labels: {}
20+
1621
# Definition of migrator jobs.
1722
#
1823
# This should

0 commit comments

Comments
 (0)