Skip to content

Commit df09df2

Browse files
committed
build(app-proxy): add telemetry configs
1 parent 25e6246 commit df09df2

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{{- define "cap-app-proxy.environment-variables.defaults" -}}
2+
{{- $accountId := include "global.codefresh.accountId" . -}}
3+
{{- $chartVersion := coalesce .Values.version .Chart.Version -}}
4+
{{- $runtimeVersion := .Chart.AppVersion -}}
5+
{{- $runtimeName := include "global.runtime.name" . -}}
6+
{{- $appProxyVersion := coalesce .Values.image.tag "latest" -}}
27
ARGO_CD_URL:
38
valueFrom:
49
configMapKeyRef:
@@ -24,6 +29,8 @@ CF_HOST:
2429
name: codefresh-cm
2530
key: base-url
2631
optional: true
32+
CF_SERVICE_NAME: {{ printf "cf-gitops-app-proxy" }}
33+
CF_SERVICE_VERSION: {{ $appProxyVersion }}
2734
CLUSTER: https://kubernetes.default.svc
2835
CLUSTER_CHUNK_SIZE:
2936
valueFrom:
@@ -223,6 +230,7 @@ CACHE_PASSWORD:
223230
key: auth
224231
{{ include "codefresh-gitops-runtime.get-proxy-env-vars" . }}
225232
{{- end -}}
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" "cf-gitops-app-proxy" $appProxyVersion "cf-gitops-runtime" $accountId "$runtimeName" "$runtimeVersion" "$chartVersion" }}
226234

227235
{{/*
228236
Read defaults from the template above and merge with the values provided in values file

charts/gitops-runtime/values.yaml

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,62 @@ app-proxy:
540540
clusterChunkSize: 50
541541
# -- Cors settings for app-proxy. This is the list of allowed domains for platform (comma separated).
542542
cors: "https://g.codefresh.io"
543-
env: {}
543+
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'
544599
serviceAccount:
545600
create: true
546601
annotations: {}

0 commit comments

Comments
 (0)