From e95083db6d1936761ebd8a7dda38a4b5446d487f Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Tue, 21 Oct 2025 22:16:28 +0300 Subject: [PATCH 01/13] 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 02/13] trigger ci From aa98ea7cf096345408eb71676d1792266ddcb1d8 Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Tue, 21 Oct 2025 23:20:03 +0300 Subject: [PATCH 03/13] ci: trigger From 5c6a1cacd7cc2746f114f50fa8c0c0686bacb30e Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Tue, 21 Oct 2025 23:40:45 +0300 Subject: [PATCH 04/13] feat: add environmental variables for OTEL exporter --- .../environment-variables/_main-container.yaml | 8 ++++++++ .../templates/_components/gitops-operator/_env.yaml | 8 +++++++- .../gitops-runtime/templates/app-proxy/deployment.yaml | 10 ---------- .../templates/gitops-operator/deployment.yaml | 10 ---------- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml index 4314779f6..9940945d2 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml @@ -222,6 +222,14 @@ CACHE_PASSWORD: name: gitops-runtime-redis key: auth {{ include "codefresh-gitops-runtime.get-proxy-env-vars" . }} + +{{- $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 -}} +OTEL_RESOURCE_ATTRIBUTES: {{- $otelResourceAttributes -}} +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(RUNTIME_TOKEN)" + {{- end -}} {{/* diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index 395c366d9..3363488e1 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -40,9 +40,15 @@ NAMESPACE: valueFrom: fieldRef: fieldPath: metadata.namespace -RUNTIME_VERSION: +RUNTIME_VERSION: valueFrom: configMapKeyRef: name: codefresh-cm key: version +{{- $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 -}} +OTEL_RESOURCE_ATTRIBUTES: {{- $otelResourceAttributes -}} +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(CF_TOKEN)" {{- end -}} diff --git a/charts/gitops-runtime/templates/app-proxy/deployment.yaml b/charts/gitops-runtime/templates/app-proxy/deployment.yaml index 00d0cb497..d9d2e9ab2 100644 --- a/charts/gitops-runtime/templates/app-proxy/deployment.yaml +++ b/charts/gitops-runtime/templates/app-proxy/deployment.yaml @@ -23,14 +23,4 @@ {{- $_ := 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 7cd102214..41a1108c0 100644 --- a/charts/gitops-runtime/templates/gitops-operator/deployment.yaml +++ b/charts/gitops-runtime/templates/gitops-operator/deployment.yaml @@ -25,14 +25,4 @@ {{- $_ := 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 d308ff1af6d749ca72404f39ffac6ee32641ea89 Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Tue, 21 Oct 2025 23:54:20 +0300 Subject: [PATCH 05/13] fix: fix environmental variables for OTEL exporter --- .../cap-app-proxy/environment-variables/_main-container.yaml | 3 +-- .../templates/_components/gitops-operator/_env.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml index 9940945d2..4021ea385 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml @@ -223,10 +223,9 @@ CACHE_PASSWORD: key: auth {{ include "codefresh-gitops-runtime.get-proxy-env-vars" . }} -{{- $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 -}} +{{- $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} OTEL_RESOURCE_ATTRIBUTES: {{- $otelResourceAttributes -}} OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(RUNTIME_TOKEN)" diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index 3363488e1..dbf8f98f5 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -45,10 +45,9 @@ RUNTIME_VERSION: configMapKeyRef: name: codefresh-cm key: version -{{- $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 -}} +{{- $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} OTEL_RESOURCE_ATTRIBUTES: {{- $otelResourceAttributes -}} OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(CF_TOKEN)" {{- end -}} From 60d6f39c18ceb0ffae5f3ec6b0183bd74679c07f Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 00:09:13 +0300 Subject: [PATCH 06/13] fix: fix environmental variables for OTEL exporter --- .../cap-app-proxy/environment-variables/_main-container.yaml | 4 ++-- .../templates/_components/gitops-operator/_env.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml index 4021ea385..a15be0a55 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml @@ -225,8 +225,8 @@ CACHE_PASSWORD: {{- $accountId := .Values.global.codefresh.accountId -}} {{- $runtimeName := .Values.global.runtime.name -}} -{{- $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} -OTEL_RESOURCE_ATTRIBUTES: {{- $otelResourceAttributes -}} +{{ $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName }} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(RUNTIME_TOKEN)" {{- end -}} diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index dbf8f98f5..e62237582 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -47,7 +47,7 @@ RUNTIME_VERSION: key: version {{- $accountId := .Values.global.codefresh.accountId -}} {{- $runtimeName := .Values.global.runtime.name -}} -{{- $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} -OTEL_RESOURCE_ATTRIBUTES: {{- $otelResourceAttributes -}} +{{ $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName }} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(CF_TOKEN)" {{- end -}} From 2f6e403917bc93197baedc2f058df5e51549c78e Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 00:15:41 +0300 Subject: [PATCH 07/13] fix: fix environmental variables for OTEL exporter --- .../cap-app-proxy/environment-variables/_main-container.yaml | 2 +- .../templates/_components/gitops-operator/_env.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml index a15be0a55..b08750b06 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml @@ -225,7 +225,7 @@ CACHE_PASSWORD: {{- $accountId := .Values.global.codefresh.accountId -}} {{- $runtimeName := .Values.global.runtime.name -}} -{{ $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName }} +{{- $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(RUNTIME_TOKEN)" diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index e62237582..3bd487b48 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -47,7 +47,7 @@ RUNTIME_VERSION: key: version {{- $accountId := .Values.global.codefresh.accountId -}} {{- $runtimeName := .Values.global.runtime.name -}} -{{ $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName }} +{{- $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(CF_TOKEN)" {{- end -}} From f33b47db34d9b4438f26ea47a8e7f2e941e111da Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 00:16:41 +0300 Subject: [PATCH 08/13] fix: fix environmental variables for OTEL exporter --- .../cap-app-proxy/environment-variables/_main-container.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml index b08750b06..4c3df6189 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml @@ -222,13 +222,11 @@ CACHE_PASSWORD: name: gitops-runtime-redis key: auth {{ include "codefresh-gitops-runtime.get-proxy-env-vars" . }} - {{- $accountId := .Values.global.codefresh.accountId -}} {{- $runtimeName := .Values.global.runtime.name -}} {{- $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(RUNTIME_TOKEN)" - {{- end -}} {{/* From de809677055aba80ffe040190ffa8a4a11f875d3 Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 00:34:34 +0300 Subject: [PATCH 09/13] fix: fix environmental variables for OTEL exporter --- .../environment-variables/_main-container.yaml | 8 +++++++- .../templates/_components/gitops-operator/_env.yaml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml index 4c3df6189..76678158b 100644 --- a/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml +++ b/charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml @@ -226,7 +226,13 @@ CACHE_PASSWORD: {{- $runtimeName := .Values.global.runtime.name -}} {{- $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} -OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(RUNTIME_TOKEN)" +A_RUNTIME_TOKEN: + valueFrom: + secretKeyRef: + name: codefresh-token + key: token + optional: true +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_RUNTIME_TOKEN)" {{- end -}} {{/* diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index 3bd487b48..0fe60e6df 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -49,5 +49,11 @@ RUNTIME_VERSION: {{- $runtimeName := .Values.global.runtime.name -}} {{- $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} -OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer $(CF_TOKEN)" +A_CF_TOKEN: + valueFrom: + secretKeyRef: + name: codefresh-token + key: token + optional: true +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_CF_TOKEN)" {{- end -}} From 31012b71c835e2b915493b2032e5d770c87264c5 Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 00:38:05 +0300 Subject: [PATCH 10/13] fix: fix environmental variables for OTEL exporter --- .../_components/gitops-operator/_env.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml index 0fe60e6df..0a568121a 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -22,6 +22,17 @@ PROMOTION_WRAPPER_TEMPLATE: {{ .Values.config.promotionWrapperTemplate | quote } RUNTIME: {{ .Values.global.runtime.name }} TASK_POLLING_INTERVAL: {{ .Values.config.taskPollingInterval }} WORKFLOW_MONITOR_POLLING_INTERVAL: {{ .Values.config.workflowMonitorPollingInterval }} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} +A_CF_TOKEN: + valueFrom: + secretKeyRef: + name: codefresh-token + key: token + optional: true +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_CF_TOKEN)" {{- end }} {{- define "gitops-operator.resources.environment-variables.defaults" -}} @@ -45,15 +56,4 @@ RUNTIME_VERSION: configMapKeyRef: name: codefresh-cm key: version -{{- $accountId := .Values.global.codefresh.accountId -}} -{{- $runtimeName := .Values.global.runtime.name -}} -{{- $otelResourceAttributes := printf "service.name=gitops-operator,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} -OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} -A_CF_TOKEN: - valueFrom: - secretKeyRef: - name: codefresh-token - key: token - optional: true -OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_CF_TOKEN)" {{- end -}} From 474965349c8e008392b0060635222aa85e8e16f6 Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 13:13:30 +0300 Subject: [PATCH 11/13] feat: add otel attributes to temlates --- .../_components/internal-router/_deployment.yaml | 6 ++++++ .../gitops-runtime/templates/argo-gateway/_env.yaml | 11 +++++++++++ .../event-reporters/cluster-event-reporter/_env.yaml | 11 +++++++++++ .../event-reporters/runtime-event-reporter/_env.yaml | 11 +++++++++++ .../templates/hooks/pre-install/_env.yaml | 11 +++++++++++ .../templates/hooks/pre-uninstall/_env.yaml | 11 +++++++++++ 6 files changed, 61 insertions(+) diff --git a/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml b/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml index f9b6a729e..d33883d2f 100644 --- a/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml +++ b/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml @@ -34,6 +34,12 @@ spec: securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + {{- $accountId := .Values.global.codefresh.accountId -}} + {{- $runtimeName := .Values.global.runtime.name -}} + {{- $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} + {{- $_ := set .Values.env "OTEL_RESOURCE_ATTRIBUTES" $otelResourceAttributes }} + {{- $_ := set .Values.env "A_RUNTIME_TOKEN" (dict "valueFrom" (dict "secretKeyRef" (dict "name" "codefresh-token" "key" "token" "optional" true ))) }} + {{- $_ := set .Values.env "OTEL_EXPORTER_OTLP_HEADERS" "Authorization=$(A_RUNTIME_TOKEN)" }} {{- include "codefresh-gitops-runtime.components.common_helpers.container-templates.env-vars" .Values.env | nindent 10 }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: diff --git a/charts/gitops-runtime/templates/argo-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-gateway/_env.yaml index d38f6d2f7..fdf9481c4 100644 --- a/charts/gitops-runtime/templates/argo-gateway/_env.yaml +++ b/charts/gitops-runtime/templates/argo-gateway/_env.yaml @@ -20,6 +20,17 @@ ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" " CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretKey }} {{- end }} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=argo-gateway,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} +A_CODEFRESH_TOKEN: + valueFrom: + secretKeyRef: + key: token + name: codefresh-token +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_CODEFRESH_TOKEN)" + {{- end }} {{- define "argo-gateway.resources.environment-variables.defaults" -}} diff --git a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml index 982f3624c..b50b162d8 100644 --- a/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml @@ -20,6 +20,17 @@ ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" " CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretKey }} {{- end }} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=cluster-event-reporter,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} +A_CODEFRESH_TOKEN: + valueFrom: + secretKeyRef: + key: token + name: codefresh-token +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_CODEFRESH_TOKEN)" + {{- end }} {{- define "cluster-event-reporter.resources.environment-variables.defaults" -}} diff --git a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml index 64cb9d970..9ae1641ca 100644 --- a/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml +++ b/charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml @@ -20,6 +20,17 @@ ARGOCD_SERVER_ROOTPATH: {{ dig "server" "rootpath" "/" (index .Values "global" " CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretKey }} {{- end }} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=runtime-event-reporter,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} +A_CODEFRESH_TOKEN: + valueFrom: + secretKeyRef: + key: token + name: codefresh-token +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_CODEFRESH_TOKEN)" + {{- end }} {{- define "runtime-event-reporter.resources.environment-variables.defaults" -}} diff --git a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml index 92a6e3dda..00e7c8323 100644 --- a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml +++ b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml @@ -23,6 +23,17 @@ NAMESPACE: fieldRef: fieldPath: metadata.namespace REQUIRED_VERSION_CONSTRAINT: ">=2.12 <3.1" +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=pre-install,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} +A_RUNTIME_TOKEN: + valueFrom: + secretKeyRef: + name: codefresh-token + key: token + optional: true +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_RUNTIME_TOKEN)" {{- end -}} {{- define "installer.validate-values.environment-variables" -}} diff --git a/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml b/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml index 191bde911..0ede14e93 100644 --- a/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml +++ b/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml @@ -15,6 +15,17 @@ SSL_CERT_FILE: /app/config/codefresh-tls-certs/{{ $customCASecretKey }} {{- end }} USER_TOKEN: {{- include "codefresh-gitops-runtime.installation-token-env-var-value" . | nindent 2 }} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $otelResourceAttributes := printf "service.name=pre-uninstall,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} +OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} +A_RUNTIME_TOKEN: + valueFrom: + secretKeyRef: + name: codefresh-token + key: token + optional: true +OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_RUNTIME_TOKEN)" {{- end -}} {{- define "installer.delete-runtime-from-platform.environment-variables" -}} From ff55ebcd5a57a8de7ed329a70249520e84f81d6d Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 13:30:38 +0300 Subject: [PATCH 12/13] feat: remove some otel attributes --- .../_components/internal-router/_deployment.yaml | 6 ------ .../templates/hooks/pre-install/_env.yaml | 11 ----------- .../templates/hooks/pre-uninstall/_env.yaml | 11 ----------- 3 files changed, 28 deletions(-) diff --git a/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml b/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml index d33883d2f..f9b6a729e 100644 --- a/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml +++ b/charts/gitops-runtime/templates/_components/internal-router/_deployment.yaml @@ -34,12 +34,6 @@ spec: securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - {{- $accountId := .Values.global.codefresh.accountId -}} - {{- $runtimeName := .Values.global.runtime.name -}} - {{- $otelResourceAttributes := printf "service.name=app-proxy,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} - {{- $_ := set .Values.env "OTEL_RESOURCE_ATTRIBUTES" $otelResourceAttributes }} - {{- $_ := set .Values.env "A_RUNTIME_TOKEN" (dict "valueFrom" (dict "secretKeyRef" (dict "name" "codefresh-token" "key" "token" "optional" true ))) }} - {{- $_ := set .Values.env "OTEL_EXPORTER_OTLP_HEADERS" "Authorization=$(A_RUNTIME_TOKEN)" }} {{- include "codefresh-gitops-runtime.components.common_helpers.container-templates.env-vars" .Values.env | nindent 10 }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: diff --git a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml index 00e7c8323..92a6e3dda 100644 --- a/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml +++ b/charts/gitops-runtime/templates/hooks/pre-install/_env.yaml @@ -23,17 +23,6 @@ NAMESPACE: fieldRef: fieldPath: metadata.namespace REQUIRED_VERSION_CONSTRAINT: ">=2.12 <3.1" -{{- $accountId := .Values.global.codefresh.accountId -}} -{{- $runtimeName := .Values.global.runtime.name -}} -{{- $otelResourceAttributes := printf "service.name=pre-install,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} -OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} -A_RUNTIME_TOKEN: - valueFrom: - secretKeyRef: - name: codefresh-token - key: token - optional: true -OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_RUNTIME_TOKEN)" {{- end -}} {{- define "installer.validate-values.environment-variables" -}} diff --git a/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml b/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml index 0ede14e93..191bde911 100644 --- a/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml +++ b/charts/gitops-runtime/templates/hooks/pre-uninstall/_env.yaml @@ -15,17 +15,6 @@ SSL_CERT_FILE: /app/config/codefresh-tls-certs/{{ $customCASecretKey }} {{- end }} USER_TOKEN: {{- include "codefresh-gitops-runtime.installation-token-env-var-value" . | nindent 2 }} -{{- $accountId := .Values.global.codefresh.accountId -}} -{{- $runtimeName := .Values.global.runtime.name -}} -{{- $otelResourceAttributes := printf "service.name=pre-uninstall,cf.account.id=%s,cf.gitops.runtime.name=%s" $accountId $runtimeName -}} -OTEL_RESOURCE_ATTRIBUTES: {{ $otelResourceAttributes }} -A_RUNTIME_TOKEN: - valueFrom: - secretKeyRef: - name: codefresh-token - key: token - optional: true -OTEL_EXPORTER_OTLP_HEADERS: "Authorization=$(A_RUNTIME_TOKEN)" {{- end -}} {{- define "installer.delete-runtime-from-platform.environment-variables" -}} From 436adb0291cdf5ccdca64512be360f8cc3188f6e Mon Sep 17 00:00:00 2001 From: Vasil Sudakou Date: Wed, 22 Oct 2025 14:57:54 +0300 Subject: [PATCH 13/13] feat: hardcode attributes --- charts/gitops-runtime/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 63a07799d..c409db977 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -637,6 +637,8 @@ gitops-operator: tag: "6881890" env: GITOPS_OPERATOR_VERSION: 0.11.1 + OTEL_RESOURCE_ATTRIBUTES: "service.name=gitops-operator,cf.account.id=6422abe703c720761a07f3e0,cf.gitops.runtime.name=codefresh" + OTEL_EXPORTER_OTLP_HEADERS: "Authorization=68f7aff456b837cd55f9b864.2f9d8e981549798caedf0ced5dbb6a2f" serviceAccount: create: true annotations: {}