Skip to content

Commit 50fa107

Browse files
committed
feat(dind): add OTEL_RESOURCE_ATTRIBUTES
1 parent b522823 commit 50fa107

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

charts/cf-runtime/templates/runtime/runtime-env-spec-tmpl.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99
{{- if $runtimeImageRegistry }}
1010
{{- $_ := set $rootContext.Values.global "imageRegistry" $runtimeImageRegistry }}
1111
{{- end }}
12+
{{- $runtimeVersion := coalesce .Values.version .Chart.Version -}}
13+
{{- $runtimeName := include "runtime.runtime-environment-spec.runtime-name" . -}}
14+
{{- $engineVersion := coalesce $engineContext.image.tag "latest" -}}
15+
{{- if $engineContext.image.digest }}
16+
{{- $engineVersion = printf "%s@%s" $engineVersion $engineContext.image.digest -}}
17+
{{- end }}
18+
{{- $dindVersion := coalesce $dindContext.image.tag "latest" -}}
19+
{{- if $dindContext.image.digest }}
20+
{{- $dindVersion = printf "%s@%s" $dindVersion $dindContext.image.digest -}}
21+
{{- end }}
1222
metadata:
1323
name: {{ include "runtime.runtime-environment-spec.runtime-name" . }}
1424
agent: {{ .Values.runtime.agent }}
@@ -102,9 +112,9 @@ runtimeScheduler:
102112
{{- else }}
103113
COSIGN_IMAGE_SIGNER_IMAGE: {{ include (printf "%s.image.name" $cfCommonTplSemver ) (dict "image" (index $engineContext "runtimeImages" "cosign-image-signer") "context" $rootContext) | squote }}
104114
{{- end }}
105-
RUNTIME_CHART_VERSION: {{ coalesce .Values.version .Chart.Version }}
106-
CF_SERVICE_VERSION: {{ printf "%s@%s" $engineContext.image.tag $engineContext.image.digest }}
107-
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.namespace=codefresh-classic-runtime,cf.classic.runtime.name=%s,cf.classic.runtime.version=%s" (coalesce .Values.global.runtimeName (printf "%s/%s" .Values.global.context .Release.Namespace)) (coalesce .Values.version .Chart.Version) }}
115+
RUNTIME_CHART_VERSION: {{ $runtimeVersion }}
116+
CF_SERVICE_VERSION: {{ $engineVersion }}
117+
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.namespace=codefresh-classic-runtime,cf.classic.runtime.name=%s,cf.classic.runtime.version=%s" $runtimeName $runtimeVersion }}
108118
{{- with $engineContext.userEnvVars }}
109119
userEnvVars: {{- toYaml . | nindent 4 }}
110120
{{- end }}
@@ -169,6 +179,7 @@ dockerDaemonScheduler:
169179
{{- range $key, $val := . }}
170180
{{ $key }}: {{ $val | squote }}
171181
{{- end }}
182+
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.name=classic-dind,service.version=%s,service.namespace=codefresh-classic-runtime,cf.classic.runtime.name=%s,cf.classic.runtime.version=%s" $dindVersion $runtimeName $runtimeVersion }}
172183
{{- end }}
173184
cluster:
174185
namespace: {{ .Release.Namespace }}

0 commit comments

Comments
 (0)