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..807ccb89 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 @@ -1,4 +1,10 @@ {{- define "cap-app-proxy.environment-variables.defaults" -}} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $chartVersion := .Chart.Version -}} +{{- $runtimeVersion := .Chart.AppVersion -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $appProxyName := "app-proxy" -}} +{{- $appProxyVersion := .Values.image.tag | default "latest" -}} ARGO_CD_URL: valueFrom: configMapKeyRef: @@ -221,6 +227,10 @@ CACHE_PASSWORD: secretKeyRef: name: gitops-runtime-redis key: auth +CF_SERVICE_NAME: {{ $appProxyName }} +CF_SERVICE_VERSION: {{ $appProxyVersion }} +OTEL_SERVICE_NAME: {{ $appProxyName }} +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 }} {{ include "codefresh-gitops-runtime.get-proxy-env-vars" . }} {{- 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..11892a07 100644 --- a/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml +++ b/charts/gitops-runtime/templates/_components/gitops-operator/_env.yaml @@ -25,6 +25,12 @@ WORKFLOW_MONITOR_POLLING_INTERVAL: {{ .Values.config.workflowMonitorPollingInter {{- end }} {{- define "gitops-operator.resources.environment-variables.defaults" -}} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $chartVersion := .Chart.Version -}} +{{- $runtimeVersion := .Chart.AppVersion -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $gitopsOperatorVersion := .Values.image.tag | default "latest" -}} +{{- $gitopsOperatorName := "gitops-operator" -}} AP_URL: http://cap-app-proxy:3017 ARGO_CD_URL: argo-cd-server:80 ARGO_WF_URL: http://argo-server:2746 @@ -45,4 +51,8 @@ RUNTIME_VERSION: configMapKeyRef: name: codefresh-cm key: version +CF_SERVICE_NAME: {{ $gitopsOperatorName }} +CF_SERVICE_VERSION: {{ $gitopsOperatorVersion }} +OTEL_SERVICE_NAME: {{ $gitopsOperatorName }} +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 }} {{- end -}} 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..e61602fa 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 @@ -23,6 +23,12 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK {{- end }} {{- define "cluster-event-reporter.resources.environment-variables.defaults" -}} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $chartVersion := .Chart.Version -}} +{{- $runtimeVersion := .Chart.AppVersion -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $eventReporterVersion := .Values.image.tag | default "latest" -}} +{{- $eventReporterName := "cluster-event-reporter" -}} REPORTER_MODE: resource APP_QUEUE_SIZE: valueFrom: @@ -186,4 +192,8 @@ RESOURCE_THREADINESS: name: cluster-event-reporter-cmd-params-cm key: resource.threadiness SERVICE_NAME: {{ include "cluster-event-reporter.fullname" . }} +CF_SERVICE_NAME: {{ $eventReporterName }} +CF_SERVICE_VERSION: {{ $eventReporterVersion }} +OTEL_SERVICE_NAME: {{ $eventReporterName }} +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 }} {{- end -}} 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..6d1e53ee 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 @@ -23,6 +23,12 @@ CODEFRESH_SSL_CERT_PATH: {{ printf "/app/config/codefresh-tls-certs/%s" $secretK {{- end }} {{- define "runtime-event-reporter.resources.environment-variables.defaults" -}} +{{- $accountId := .Values.global.codefresh.accountId -}} +{{- $chartVersion := .Chart.Version -}} +{{- $runtimeVersion := .Chart.AppVersion -}} +{{- $runtimeName := .Values.global.runtime.name -}} +{{- $eventReporterVersion := .Values.image.tag | default "latest" -}} +{{- $eventReporterName := "runtime-event-reporter" -}} REPORTER_MODE: app APP_QUEUE_SIZE: valueFrom: @@ -186,4 +192,8 @@ RESOURCE_THREADINESS: name: runtime-event-reporter-cmd-params-cm key: resource.threadiness SERVICE_NAME: {{ include "runtime-event-reporter.fullname" . }} +CF_SERVICE_NAME: {{ $eventReporterName }} +CF_SERVICE_VERSION: {{ $eventReporterVersion }} +OTEL_SERVICE_NAME: {{ $eventReporterName }} +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 }} {{- end -}} diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 089660f8..d0563059 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -189,6 +189,45 @@ global: scrapeTimeout: 10s labels: {} config: {} + +anchors: + common-envs: + # -- Telemetry configuration + - &otel-config + # -- Base endpoint URL for all OpenTelemetry signals. + # Ref: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/ + OTEL_EXPORTER_OTLP_ENDPOINT: 'http://localhost:4317' + # -- Specifies the OTLP transport protocol to be used for all telemetry data. + # Ref: https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/ + OTEL_EXPORTER_OTLP_PROTOCOL: 'grpc' + # -- Specifies the compression algorithm to be used for all telemetry data. + # Ref: https://opentelemetry.io/docs/specs/otel/protocol/exporter/ + OTEL_EXPORTER_OTLP_COMPRESSION: 'gzip' + # -- OTel Logs exporter to be used. + # Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + OTEL_LOGS_EXPORTER: 'none' + # -- OTel traces exporter to be used. + # Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + OTEL_TRACES_EXPORTER: 'none' + # -- OTel sampler to be used for traces. + # Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + OTEL_TRACES_SAMPLER: 'parentbased_always_on' + # -- 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. + # Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + OTEL_METRICS_EXPORTER: 'none' + # -- The time interval (in milliseconds) between the start of two export attempts for push metric exporters, such as "otlp". + # Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + OTEL_METRIC_EXPORT_INTERVAL: '10000' + # -- Maximum allowed time (in milliseconds) to export data for push metric exporters, such as "otlp". + # Ref: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ + OTEL_METRIC_EXPORT_TIMEOUT: '5000' + # -- Host used by the Prometheus OTel metrics exporter if OTEL_METRICS_EXPORTER=prometheus + OTEL_EXPORTER_PROMETHEUS_HOST: '0.0.0.0' + # -- Port used by the Prometheus OTel metrics exporter if OTEL_METRICS_EXPORTER=prometheus + OTEL_EXPORTER_PROMETHEUS_PORT: '9464' + # -- Emit the stable HTTP and networking OTel conventions if CF_TELEMETRY_OTEL_ALLOW_HTTP_INSTRUMENTATION=true. + OTEL_SEMCONV_STABILITY_OPT_IN: 'http' + # ------------------------------------------------------------------------------------------------------------------------- # Installer # ------------------------------------------------------------------------------------------------------------------------- @@ -530,7 +569,30 @@ app-proxy: clusterChunkSize: 50 # -- Cors settings for app-proxy. This is the list of allowed domains for platform (comma separated). cors: "https://g.codefresh.io" - env: {} + env: + <<: + - *otel-config + # -- Level of logging for app-proxy + CF_TELEMETRY_LOGS_LEVEL: 'info' + # -- Level for logging HTTP requests + CF_TELEMETRY_LOGS_LEVEL_HTTP: 'debug' + # -- Enable OpenTelemetry signals (logs, metrics, traces) + CF_TELEMETRY_OTEL_ENABLE: 'false' + # -- Enable OTel HTTP instrumentation. + # Make sure to sanitize `url.full` and `url.query` span attributes on collector before enabling this flag, as it may contain sensitive information. + CF_TELEMETRY_OTEL_ALLOW_HTTP_INSTRUMENTATION: 'false' + # -- Enable Prometheus server + CF_TELEMETRY_PROMETHEUS_ENABLE: 'false' + # -- Enable collecting process metrics + CF_TELEMETRY_PROMETHEUS_ENABLE_PROCESS_METRICS: 'false' + # -- Host for Prometheus metrics server + CF_TELEMETRY_PROMETHEUS_HOST: '0.0.0.0' + # -- Port for Prometheus metrics server + CF_TELEMETRY_PROMETHEUS_PORT: '9100' + # -- Enable Pyroscope profiling. If enabled, the Pyroscope server address must be set in PYROSCOPE_SERVER_ADDRESS. + CF_TELEMETRY_PYROSCOPE_ENABLE: 'false' + # -- Pyroscope server address + PYROSCOPE_SERVER_ADDRESS: '' serviceAccount: create: true annotations: {} @@ -628,6 +690,8 @@ gitops-operator: repository: codefresh/codefresh-gitops-operator tag: "293f24f" env: + <<: + - *otel-config GITOPS_OPERATOR_VERSION: 0.11.1 serviceAccount: create: true @@ -793,8 +857,14 @@ redis: name: "" annotations: {} event-reporters: - cluster-event-reporter: {} - runtime-event-reporter: {} + cluster-event-reporter: + env: + <<: + - *otel-config + runtime-event-reporter: + env: + <<: + - *otel-config # -- Redis-HA subchart replaces custom redis deployment when `redis-ha.enabled=true` # Ref: https://github.com/DandyDeveloper/charts/blob/master/charts/redis-ha/values.yaml redis-ha: