Skip to content

Commit ee888a9

Browse files
committed
build: add telemetry configs
1 parent 356be2e commit ee888a9

File tree

5 files changed

+107
-60
lines changed

5 files changed

+107
-60
lines changed

charts/gitops-runtime/templates/_components/cap-app-proxy/environment-variables/_main-container.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{- $chartVersion := .Chart.Version -}}
44
{{- $runtimeVersion := .Chart.AppVersion -}}
55
{{- $runtimeName := .Values.global.runtime.name -}}
6+
{{- $appProxyName := "cf-gitops-app-proxy" -}}
67
{{- $appProxyVersion := .Values.image.tag | default "latest" -}}
78
ARGO_CD_URL:
89
valueFrom:
@@ -29,8 +30,6 @@ CF_HOST:
2930
name: codefresh-cm
3031
key: base-url
3132
optional: true
32-
CF_SERVICE_NAME: {{ printf "cf-gitops-app-proxy" }}
33-
CF_SERVICE_VERSION: {{ $appProxyVersion }}
3433
CLUSTER: https://kubernetes.default.svc
3534
CLUSTER_CHUNK_SIZE:
3635
valueFrom:
@@ -228,7 +227,10 @@ CACHE_PASSWORD:
228227
secretKeyRef:
229228
name: gitops-runtime-redis
230229
key: auth
231-
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.name=%s,service.version=%s,service.namespace=%s,cf.account.id=%s,cf.gitops.runtime.name=%s,cf.gitops.runtime.version=%s,cf.gitops.runtime.chart.version=%s" "cf-gitops-app-proxy" $appProxyVersion "cf-gitops-runtime" $accountId $runtimeName $runtimeVersion $chartVersion }}
230+
CF_SERVICE_NAME: {{ $appProxyName }}
231+
CF_SERVICE_VERSION: {{ $appProxyVersion }}
232+
OTEL_SERVICE_NAME: {{ $appProxyName }}
233+
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.name=%s,service.version=%s,service.namespace=%s,cf.account.id=%s,cf.gitops.runtime.name=%s,cf.gitops.runtime.version=%s,cf.gitops.runtime.chart.version=%s" $appProxyName $appProxyVersion "cf-gitops-runtime" $accountId $runtimeName $runtimeVersion $chartVersion }}
232234
{{ include "codefresh-gitops-runtime.get-proxy-env-vars" . }}
233235
{{- end -}}
234236

charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ WORKFLOW_MONITOR_POLLING_INTERVAL: {{ .Values.config.workflowMonitorPollingInter
2525
{{- end }}
2626

2727
{{- define "gitops-operator.resources.environment-variables.defaults" -}}
28+
{{- $accountId := .Values.global.codefresh.accountId -}}
29+
{{- $chartVersion := .Chart.Version -}}
30+
{{- $runtimeVersion := .Chart.AppVersion -}}
31+
{{- $runtimeName := .Values.global.runtime.name -}}
32+
{{- $gitopsOperatorVersion := .Values.image.tag | default "latest" -}}
33+
{{- $gitopsOperatorName := "cf-gitops-gitops-operator" -}}
2834
AP_URL: http://cap-app-proxy:3017
2935
ARGO_CD_URL: argo-cd-server:80
3036
ARGO_WF_URL: http://argo-server:2746
@@ -45,4 +51,8 @@ RUNTIME_VERSION:
4551
configMapKeyRef:
4652
name: codefresh-cm
4753
key: version
54+
CF_SERVICE_NAME: {{ $gitopsOperatorName }}
55+
CF_SERVICE_VERSION: {{ $gitopsOperatorVersion }}
56+
OTEL_SERVICE_NAME: {{ $gitopsOperatorName }}
57+
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.name=%s,service.version=%s,service.namespace=%s,cf.account.id=%s,cf.gitops.runtime.name=%s,cf.gitops.runtime.version=%s,cf.gitops.runtime.chart.version=%s" $gitopsOperatorName $gitopsOperatorVersion "cf-gitops-runtime" $accountId $runtimeName $runtimeVersion $chartVersion }}
4858
{{- end -}}

charts/gitops-runtime/templates/event-reporters/cluster-event-reporter/_env.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK
2323
{{- end }}
2424

2525
{{- define "cluster-event-reporter.resources.environment-variables.defaults" -}}
26+
{{- $accountId := .Values.global.codefresh.accountId -}}
27+
{{- $chartVersion := .Chart.Version -}}
28+
{{- $runtimeVersion := .Chart.AppVersion -}}
29+
{{- $runtimeName := .Values.global.runtime.name -}}
30+
{{- $eventReporterVersion := .Values.image.tag | default "latest" -}}
31+
{{- $eventReporterName := "cf-gitops-cluster-event-reporter" -}}
2632
REPORTER_MODE: resource
2733
APP_QUEUE_SIZE:
2834
valueFrom:
@@ -186,4 +192,8 @@ RESOURCE_THREADINESS:
186192
name: cluster-event-reporter-cmd-params-cm
187193
key: resource.threadiness
188194
SERVICE_NAME: {{ include "cluster-event-reporter.fullname" . }}
195+
CF_SERVICE_NAME: {{ $eventReporterName }}
196+
CF_SERVICE_VERSION: {{ $eventReporterVersion }}
197+
OTEL_SERVICE_NAME: {{ $eventReporterName }}
198+
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.name=%s,service.version=%s,service.namespace=%s,cf.account.id=%s,cf.gitops.runtime.name=%s,cf.gitops.runtime.version=%s,cf.gitops.runtime.chart.version=%s" $eventReporterName $eventReporterVersion "cf-gitops-runtime" $accountId $runtimeName $runtimeVersion $chartVersion }}
189199
{{- end -}}

charts/gitops-runtime/templates/event-reporters/runtime-event-reporter/_env.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK
2323
{{- end }}
2424

2525
{{- define "runtime-event-reporter.resources.environment-variables.defaults" -}}
26+
{{- $accountId := .Values.global.codefresh.accountId -}}
27+
{{- $chartVersion := .Chart.Version -}}
28+
{{- $runtimeVersion := .Chart.AppVersion -}}
29+
{{- $runtimeName := .Values.global.runtime.name -}}
30+
{{- $eventReporterVersion := .Values.image.tag | default "latest" -}}
31+
{{- $eventReporterName := "cf-gitops-runtime-event-reporter" -}}
2632
REPORTER_MODE: app
2733
APP_QUEUE_SIZE:
2834
valueFrom:
@@ -186,4 +192,8 @@ RESOURCE_THREADINESS:
186192
name: runtime-event-reporter-cmd-params-cm
187193
key: resource.threadiness
188194
SERVICE_NAME: {{ include "runtime-event-reporter.fullname" . }}
195+
CF_SERVICE_NAME: {{ $eventReporterName }}
196+
CF_SERVICE_VERSION: {{ $eventReporterVersion }}
197+
OTEL_SERVICE_NAME: {{ $eventReporterName }}
198+
OTEL_RESOURCE_ATTRIBUTES: {{ printf "service.name=%s,service.version=%s,service.namespace=%s,cf.account.id=%s,cf.gitops.runtime.name=%s,cf.gitops.runtime.version=%s,cf.gitops.runtime.chart.version=%s" $eventReporterName $eventReporterVersion "cf-gitops-runtime" $accountId $runtimeName $runtimeVersion $chartVersion }}
189199
{{- end -}}

charts/gitops-runtime/values.yaml

Lines changed: 72 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,66 @@ global:
189189
scrapeTimeout: 10s
190190
labels: {}
191191
config: {}
192+
193+
anchors:
194+
common-envs:
195+
# -- Telemetry configuration
196+
- &telemetry-config
197+
# -- Level of logging for app-proxy
198+
CF_TELEMETRY_LOGS_LEVEL: 'info'
199+
# -- Level for logging HTTP requests
200+
CF_TELEMETRY_LOGS_LEVEL_HTTP: 'debug'
201+
# -- Enable OpenTelemetry signals (logs, metrics, traces)
202+
CF_TELEMETRY_OTEL_ENABLE: 'false'
203+
# -- Enable OTel HTTP instrumentation.
204+
# Make sure to sanitize `url.full` and `url.query` span attributes on collector before enabling this flag, as it may contain sensitive information.
205+
CF_TELEMETRY_OTEL_ALLOW_HTTP_INSTRUMENTATION: 'false'
206+
# -- Enable Prometheus server
207+
CF_TELEMETRY_PROMETHEUS_ENABLE: 'false'
208+
# -- Enable collecting process metrics
209+
CF_TELEMETRY_PROMETHEUS_ENABLE_PROCESS_METRICS: 'false'
210+
# -- Host for Prometheus metrics server
211+
CF_TELEMETRY_PROMETHEUS_HOST: '0.0.0.0'
212+
# -- Port for Prometheus metrics server
213+
CF_TELEMETRY_PROMETHEUS_PORT: '9100'
214+
# -- Enable Pyroscope profiling. If enabled, the Pyroscope server address must be set in PYROSCOPE_SERVER_ADDRESS.
215+
CF_TELEMETRY_PYROSCOPE_ENABLE: 'false'
216+
# -- Pyroscope server address
217+
PYROSCOPE_SERVER_ADDRESS: ''
218+
# -- Base endpoint URL for all OpenTelemetry signals.
219+
# Ref: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
220+
OTEL_EXPORTER_OTLP_ENDPOINT: 'http://localhost:4317'
221+
# -- Specifies the OTLP transport protocol to be used for all telemetry data.
222+
# Ref: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
223+
OTEL_EXPORTER_OTLP_PROTOCOL: 'grpc'
224+
# -- Specifies the compression algorithm to be used for all telemetry data.
225+
# Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/
226+
OTEL_EXPORTER_OTLP_COMPRESSION: 'gzip'
227+
# -- OTel Logs exporter to be used.
228+
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
229+
OTEL_LOGS_EXPORTER: 'none'
230+
# -- OTel traces exporter to be used.
231+
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
232+
OTEL_TRACES_EXPORTER: 'none'
233+
# -- OTel sampler to be used for traces.
234+
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
235+
OTEL_TRACES_SAMPLER: 'parentbased_always_on'
236+
# -- OTel metrics exporter to be used. Set to "prometheus" to export metrics in Prometheus format. If set to "prometheus", it's recommended to set METRICS_SCRAPE_TIMEOUT_MS=4×scrape_interval.
237+
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
238+
OTEL_METRICS_EXPORTER: 'none'
239+
# -- The time interval (in milliseconds) between the start of two export attempts for push metric exporters, such as "otlp".
240+
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
241+
OTEL_METRIC_EXPORT_INTERVAL: '10000'
242+
# -- Maximum allowed time (in milliseconds) to export data for push metric exporters, such as "otlp".
243+
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
244+
OTEL_METRIC_EXPORT_TIMEOUT: '5000'
245+
# -- Host used by the Prometheus OTel metrics exporter if OTEL_METRICS_EXPORTER=prometheus
246+
OTEL_EXPORTER_PROMETHEUS_HOST: '0.0.0.0'
247+
# -- Port used by the Prometheus OTel metrics exporter if OTEL_METRICS_EXPORTER=prometheus
248+
OTEL_EXPORTER_PROMETHEUS_PORT: '9464'
249+
# -- Emit the stable HTTP and networking OTel conventions if CF_TELEMETRY_OTEL_ALLOW_HTTP_INSTRUMENTATION=true.
250+
OTEL_SEMCONV_STABILITY_OPT_IN: 'http'
251+
192252
# -------------------------------------------------------------------------------------------------------------------------
193253
# Installer
194254
# -------------------------------------------------------------------------------------------------------------------------
@@ -541,61 +601,8 @@ app-proxy:
541601
# -- Cors settings for app-proxy. This is the list of allowed domains for platform (comma separated).
542602
cors: "https://g.codefresh.io"
543603
env:
544-
# -- Telemetry configuration
545-
# -- Level of logging for app-proxy
546-
CF_TELEMETRY_LOGS_LEVEL: 'info'
547-
# -- Level for logging HTTP requests
548-
CF_TELEMETRY_LOGS_LEVEL_HTTP: 'debug'
549-
# -- Enable OpenTelemetry signals (logs, metrics, traces)
550-
CF_TELEMETRY_OTEL_ENABLE: 'false'
551-
# -- Enable OTel HTTP instrumentation.
552-
# Make sure to sanitize `url.full` and `url.query` span attributes on collector before enabling this flag, as it may contain sensitive information.
553-
CF_TELEMETRY_OTEL_ALLOW_HTTP_INSTRUMENTATION: 'false'
554-
# -- Enable Prometheus server
555-
CF_TELEMETRY_PROMETHEUS_ENABLE: 'false'
556-
# -- Enable collecting process metrics
557-
CF_TELEMETRY_PROMETHEUS_ENABLE_PROCESS_METRICS: 'false'
558-
# -- Host for Prometheus metrics server
559-
CF_TELEMETRY_PROMETHEUS_HOST: '0.0.0.0'
560-
# -- Port for Prometheus metrics server
561-
CF_TELEMETRY_PROMETHEUS_PORT: '9100'
562-
# -- Enable Pyroscope profiling. If enabled, the Pyroscope server address must be set in PYROSCOPE_SERVER_ADDRESS.
563-
CF_TELEMETRY_PYROSCOPE_ENABLE: 'false'
564-
# -- Pyroscope server address
565-
PYROSCOPE_SERVER_ADDRESS: ''
566-
# -- Base endpoint URL for all OpenTelemetry signals.
567-
# Ref: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
568-
OTEL_EXPORTER_OTLP_ENDPOINT: 'http://localhost:4317'
569-
# -- Specifies the OTLP transport protocol to be used for all telemetry data.
570-
# Ref: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/
571-
OTEL_EXPORTER_OTLP_PROTOCOL: 'grpc'
572-
# -- Specifies the compression algorithm to be used for all telemetry data.
573-
# Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/
574-
OTEL_EXPORTER_OTLP_COMPRESSION: 'gzip'
575-
# -- OTel Logs exporter to be used.
576-
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
577-
OTEL_LOGS_EXPORTER: 'none'
578-
# -- OTel traces exporter to be used.
579-
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
580-
OTEL_TRACES_EXPORTER: 'none'
581-
# -- OTel sampler to be used for traces.
582-
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
583-
OTEL_TRACES_SAMPLER: 'parentbased_always_on'
584-
# -- OTel metrics exporter to be used. Set to "prometheus" to export metrics in Prometheus format. If set to "prometheus", it's recommended to set METRICS_SCRAPE_TIMEOUT_MS=4×scrape_interval.
585-
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
586-
OTEL_METRICS_EXPORTER: 'none'
587-
# -- The time interval (in milliseconds) between the start of two export attempts for push metric exporters, such as "otlp".
588-
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
589-
OTEL_METRIC_EXPORT_INTERVAL: '10000'
590-
# -- Maximum allowed time (in milliseconds) to export data for push metric exporters, such as "otlp".
591-
# Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
592-
OTEL_METRIC_EXPORT_TIMEOUT: '5000'
593-
# -- Host used by the Prometheus OTel metrics exporter if OTEL_METRICS_EXPORTER=prometheus
594-
OTEL_EXPORTER_PROMETHEUS_HOST: '0.0.0.0'
595-
# -- Port used by the Prometheus OTel metrics exporter if OTEL_METRICS_EXPORTER=prometheus
596-
OTEL_EXPORTER_PROMETHEUS_PORT: '9464'
597-
# -- Emit the stable HTTP and networking OTel conventions if CF_TELEMETRY_OTEL_ALLOW_HTTP_INSTRUMENTATION=true.
598-
OTEL_SEMCONV_STABILITY_OPT_IN: 'http'
604+
<<:
605+
- *telemetry-config
599606
serviceAccount:
600607
create: true
601608
annotations: {}
@@ -693,6 +700,8 @@ gitops-operator:
693700
repository: codefresh/codefresh-gitops-operator
694701
tag: "2784cd5"
695702
env:
703+
<<:
704+
- *telemetry-config
696705
GITOPS_OPERATOR_VERSION: 0.11.1
697706
serviceAccount:
698707
create: true
@@ -858,8 +867,14 @@ redis:
858867
name: ""
859868
annotations: {}
860869
event-reporters:
861-
cluster-event-reporter: {}
862-
runtime-event-reporter: {}
870+
cluster-event-reporter:
871+
env:
872+
<<:
873+
- *telemetry-config
874+
runtime-event-reporter:
875+
env:
876+
<<:
877+
- *telemetry-config
863878
# -- Redis-HA subchart replaces custom redis deployment when `redis-ha.enabled=true`
864879
# Ref: https://github.com/DandyDeveloper/charts/blob/master/charts/redis-ha/values.yaml
865880
redis-ha:

0 commit comments

Comments
 (0)