Skip to content

Commit 024ce12

Browse files
authored
Fix the inclusion of the destination secret for Service Graph instance (#2200)
1 parent e55de55 commit 024ce12

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

charts/k8s-monitoring/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
* Fix the inclusion of the destination secret for Service Graph instance (@petewall)
56
* Update Alloy Operator to 0.3.14 (@petewall)
67

78
## 3.6.1

charts/k8s-monitoring/templates/alloy-servicegraph.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,30 @@
1818
{{- $destinationConfigComponents := "" }}
1919
{{- range $metricsDestinationName := $metricsDestinationNames }}
2020
{{- $dest := include "destination.getDestinationByName" (deepCopy $ | merge (dict "destination" $metricsDestinationName )) | fromYaml }}
21-
{{- if eq $dest.type "prometheus" -}}
22-
{{- $defaultValues := "destinations/prometheus-values.yaml" | $.Files.Get | fromYaml }}
23-
{{- $destWithDefaults := mergeOverwrite (deepCopy $defaultValues) $dest }}
24-
{{- $destinationTarget := include "destinations.prometheus.alloy.otlp.metrics.target" $destWithDefaults }}
25-
{{- $destinationTargets = append $destinationTargets (printf "%s" $destinationTarget) }}
26-
{{- else }}
27-
{{- $defaultValues := "destinations/otlp-values.yaml" | $.Files.Get | fromYaml }}
28-
{{- $destWithDefaults := mergeOverwrite (deepCopy $defaultValues) $dest }}
29-
{{- $destinationTarget := include "destinations.otlp.alloy.exporter.target" $destWithDefaults }}
30-
{{- $destinationTargets = append $destinationTargets (printf "%s" $destinationTarget) }}
31-
{{- end }}
3221
{{- $destinationConfigComponents = cat $destinationConfigComponents (printf "\n\n// Destination: %s (%s)" $dest.name $dest.type) }}
33-
{{- if eq (include "secrets.usesKubernetesSecret" $dest) "true" }}
34-
{{- $destinationConfigComponents = cat $destinationConfigComponents (include "secret.alloy" (deepCopy $ | merge (dict "object" $dest)) | nindent 0) }}
35-
{{- end }}
3622
{{- if eq $dest.type "prometheus" -}}
3723
{{- $defaultValues := "destinations/prometheus-values.yaml" | $.Files.Get | fromYaml }}
3824
{{- $destWithDefaults := mergeOverwrite (deepCopy $defaultValues) $dest }}
3925
{{- $destWithDefaults = set $destWithDefaults "extraLabelsFrom" (dict "collector_id" "env(\"POD_NAME\")") }}
26+
27+
{{- $destinationTarget := include "destinations.prometheus.alloy.otlp.metrics.target" $destWithDefaults }}
28+
{{- $destinationTargets = append $destinationTargets (printf "%s" $destinationTarget) }}
29+
4030
{{- $destinationConfigComponents = cat $destinationConfigComponents ((include "destinations.prometheus.alloy" (deepCopy $ | merge (dict "destination" $destWithDefaults))) | trim | nindent 0) }}
31+
{{- if eq (include "secrets.usesKubernetesSecret" $destWithDefaults) "true" }}
32+
{{- $destinationConfigComponents = cat $destinationConfigComponents (include "secret.alloy" (deepCopy $ | merge (dict "object" $destWithDefaults)) | nindent 0) }}
33+
{{- end }}
4134
{{- else -}}
4235
{{- $defaultValues := "destinations/otlp-values.yaml" | $.Files.Get | fromYaml }}
4336
{{- $destWithDefaults := mergeOverwrite (deepCopy $defaultValues) $dest }}
37+
38+
{{- $destinationTarget := include "destinations.otlp.alloy.exporter.target" $destWithDefaults }}
39+
{{- $destinationTargets = append $destinationTargets (printf "%s" $destinationTarget) }}
40+
4441
{{- $destinationConfigComponents = cat $destinationConfigComponents ((include "destinations.otlp.alloy.exporter" $destWithDefaults) | trim | nindent 0) }}
42+
{{- if eq (include "secrets.usesKubernetesSecret" $destWithDefaults) "true" }}
43+
{{- $destinationConfigComponents = cat $destinationConfigComponents (include "secret.alloy" (deepCopy $ | merge (dict "object" $destWithDefaults)) | nindent 0) }}
44+
{{- end }}
4545
{{- end }}
4646
{{- end }}
4747

0 commit comments

Comments
 (0)