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 4314779f..76678158 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,17 @@ 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 }} +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 395c366d..0a568121 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" -}} @@ -40,7 +51,7 @@ NAMESPACE: valueFrom: fieldRef: fieldPath: metadata.namespace -RUNTIME_VERSION: +RUNTIME_VERSION: valueFrom: configMapKeyRef: name: codefresh-cm diff --git a/charts/gitops-runtime/templates/argo-gateway/_env.yaml b/charts/gitops-runtime/templates/argo-gateway/_env.yaml index d38f6d2f..fdf9481c 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 982f3624..b50b162d 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 64cb9d97..9ae1641c 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/values.yaml b/charts/gitops-runtime/values.yaml index 63a07799..c409db97 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: {}