Skip to content

Commit e95083d

Browse files
committed
feat: add environmental variables for OTEL exporter
1 parent d1d6478 commit e95083d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

charts/gitops-runtime/templates/app-proxy/deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,14 @@
2323
{{- $_ := set $appProxyContext.Values.initContainer "extraVolumeMounts" $initContainerExtraVolumeMounts }}
2424
{{- end }}
2525

26+
{{- $serviceVersion := printf "%s@%s" (index .Values "app-proxy" "image" "tag") (index .Values "app-proxy" "image" "digest") -}}
27+
{{- $accountId := .Values.global.codefresh.accountId -}}
28+
{{- $runtimeName := .Values.global.runtime.name -}}
29+
{{- $otelResourceAttributes := printf "service.name=app-proxy,service.version=%s,cf.account.id=%s,cf.gitops.runtime.name=%s" $serviceVersion $accountId $runtimeName -}}
30+
{{- $__ := set $appProxyContext.Values.env "OTEL_RESOURCE_ATTRIBUTES" $otelResourceAttributes -}}
31+
32+
{{- $token := .Values.global.codefresh.userToken.token -}}
33+
{{- $otelExporterOtlpHeaders := printf "Authorization=Bearer %s" $token -}}
34+
{{- $___ := set $appProxyContext.Values.env "OTEL_EXPORTER_OTLP_HEADERS" $otelExporterOtlpHeaders -}}
35+
2636
{{- include "cap-app-proxy.resources.deployment" $appProxyContext }}

charts/gitops-runtime/templates/gitops-operator/deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,14 @@
2525
{{- $_ := set $context.Values.global.codefresh.tls.caCerts.secretKeyRef "key" ($context.Values.global.codefresh.tls.caCerts.secret.create | ternary (default "ca-bundle.crt" $context.Values.global.codefresh.tls.caCerts.secret.key) $context.Values.global.codefresh.tls.caCerts.secretKeyRef.key) }}
2626
{{- end }}
2727

28+
{{- $serviceVersion := printf "%s@%s" (index .Values "gitops-operator" "image" "tag") (index .Values "gitops-operator" "image" "digest") -}}
29+
{{- $accountId := .Values.global.codefresh.accountId -}}
30+
{{- $runtimeName := .Values.global.runtime.name -}}
31+
{{- $otelResourceAttributes := printf "service.name=gitops-operator,service.version=%s,cf.account.id=%s,cf.gitops.runtime.name=%s" $serviceVersion $accountId $runtimeName -}}
32+
{{- $__ := set $context.Values.env "OTEL_RESOURCE_ATTRIBUTES" $otelResourceAttributes -}}
33+
34+
{{- $token := .Values.global.codefresh.userToken.token -}}
35+
{{- $otelExporterOtlpHeaders := printf "Authorization=Bearer %s" $token -}}
36+
{{- $___ := set $context.Values.env "OTEL_EXPORTER_OTLP_HEADERS" $otelExporterOtlpHeaders -}}
37+
2838
{{- include "gitops-operator.resources.deployment" $context }}

0 commit comments

Comments
 (0)