From e95083db6d1936761ebd8a7dda38a4b5446d487f Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Tue, 21 Oct 2025 22:16:28 +0300 Subject: [PATCH 1/2] feat: add environmental variables for OTEL exporter --- .../gitops-runtime/templates/app-proxy/deployment.yaml | 10 ++++++++++ .../templates/gitops-operator/deployment.yaml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/charts/gitops-runtime/templates/app-proxy/deployment.yaml b/charts/gitops-runtime/templates/app-proxy/deployment.yaml index d9d2e9ab2..00d0cb497 100644 --- a/charts/gitops-runtime/templates/app-proxy/deployment.yaml +++ b/charts/gitops-runtime/templates/app-proxy/deployment.yaml @@ -23,4 +23,14 @@ {{- $_ := set $appProxyContext.Values.initContainer "extraVolumeMounts" $initContainerExtraVolumeMounts }} {{- end }} +{{- $serviceVersion := printf "%s@%s" (index .Values "app-proxy" "image" "tag") (index .Values "app-proxy" "image" "digest") -}} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=app-proxy,service.version=%s,cf.account.id=%s,cf.gitops.runtime.name=%s" $serviceVersion $accountId $runtimeName -}} +{{- $__ := set $appProxyContext.Values.env "OTEL_RESOURCE_ATTRIBUTES" $otelResourceAttributes -}} + +{{- $token := .Values.global.codefresh.userToken.token -}} +{{- $otelExporterOtlpHeaders := printf "Authorization=Bearer %s" $token -}} +{{- $___ := set $appProxyContext.Values.env "OTEL_EXPORTER_OTLP_HEADERS" $otelExporterOtlpHeaders -}} + {{- include "cap-app-proxy.resources.deployment" $appProxyContext }} diff --git a/charts/gitops-runtime/templates/gitops-operator/deployment.yaml b/charts/gitops-runtime/templates/gitops-operator/deployment.yaml index 41a1108c0..7cd102214 100644 --- a/charts/gitops-runtime/templates/gitops-operator/deployment.yaml +++ b/charts/gitops-runtime/templates/gitops-operator/deployment.yaml @@ -25,4 +25,14 @@ {{- $_ := 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) }} {{- end }} +{{- $serviceVersion := printf "%s@%s" (index .Values "gitops-operator" "image" "tag") (index .Values "gitops-operator" "image" "digest") -}} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=gitops-operator,service.version=%s,cf.account.id=%s,cf.gitops.runtime.name=%s" $serviceVersion $accountId $runtimeName -}} +{{- $__ := set $context.Values.env "OTEL_RESOURCE_ATTRIBUTES" $otelResourceAttributes -}} + +{{- $token := .Values.global.codefresh.userToken.token -}} +{{- $otelExporterOtlpHeaders := printf "Authorization=Bearer %s" $token -}} +{{- $___ := set $context.Values.env "OTEL_EXPORTER_OTLP_HEADERS" $otelExporterOtlpHeaders -}} + {{- include "gitops-operator.resources.deployment" $context }} From 5994c0cba05c8f789c8eed1c4563f66a23ddc879 Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Tue, 21 Oct 2025 23:17:11 +0300 Subject: [PATCH 2/2] trigger ci