From 63a1ee4db3258802b1974a22476f797a2efb5542 Mon Sep 17 00:00:00 2001 From: shlomiko Date: Thu, 10 Sep 2026 15:21:18 +0300 Subject: [PATCH 1/3] fix(helm): split env values into server and telemetry scopes Align the chart with ts-server-boilerplate: - move port, targetPort, protocol, requestPayloadLimit and responseCompressionEnabled from env to a server scope; the remaining env keys (httpRetry, disableHttpClientLogs, shapefileReader) stay - add a telemetry scope (logger.level, logger.prettyPrint, logger.opentelemetryOptions, tracing) replacing env.logLevel, env.logPrettyPrintEnabled and env.openTelemetryOptions - global overrides move under global.telemetry; only the tracing and otlp logger urls are overridable from global and take precedence - export the otlp logger url as OTLP_LOGGER_ENDPOINT_URL and resource attributes as OTEL_RESOURCE_ATTRIBUTES (key=value list), the names the config schema and the OpenTelemetry SDK read; map them the same way in custom-environment-variables.json - add tracingUrl, opentelemetryLoggingUrl and otelResourceAttributes helpers, drop the merged tracing/openTelemetryOptions helpers Co-Authored-By: Claude Fable 5.1 --- config/custom-environment-variables.json | 7 ++--- helm/templates/_helpers.tpl | 36 +++++++++++++++++++++++- helm/templates/_tplValues.tpl | 8 ------ helm/templates/configmap.yaml | 36 +++++++++++++++--------- helm/templates/deployment.yaml | 11 ++++---- helm/templates/service.yaml | 7 +++-- helm/values.yaml | 30 ++++++++++++++------ 7 files changed, 90 insertions(+), 45 deletions(-) diff --git a/config/custom-environment-variables.json b/config/custom-environment-variables.json index 4a908c8b..dea24d82 100644 --- a/config/custom-environment-variables.json +++ b/config/custom-environment-variables.json @@ -22,11 +22,8 @@ "__name": "OPENTELEMETRY_LOGGING_ENABLED", "__format": "boolean" }, - "url": "OPENTELEMETRY_LOGGING_URL", - "resourceAttributes": { - "__name": "OPENTELEMETRY_RESOURCE_ATTRIBUTES", - "__format": "json" - } + "url": "OTLP_LOGGER_ENDPOINT_URL", + "resourceAttributes": "OTEL_RESOURCE_ATTRIBUTES" } }, "shared": {}, diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index 9e92ac76..86e8e21c 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -106,4 +106,38 @@ Create chart name and version as used by the chart label. */}} {{- define "overseer.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} \ No newline at end of file +{{- end }} + +{{/* +Returns the tracing url from global if set, otherwise from the chart's values +*/}} +{{- define "overseer.tracingUrl" -}} +{{- if .Values.global.telemetry.tracing.url }} + {{- .Values.global.telemetry.tracing.url -}} +{{- else if .Values.telemetry.tracing.url -}} + {{- .Values.telemetry.tracing.url -}} +{{- end -}} +{{- end -}} + +{{/* +Returns the opentelemetry logging url from global if set, otherwise from the chart's values +*/}} +{{- define "overseer.opentelemetryLoggingUrl" -}} +{{- if .Values.global.telemetry.logger.opentelemetryOptions.url }} + {{- .Values.global.telemetry.logger.opentelemetryOptions.url -}} +{{- else if .Values.telemetry.logger.opentelemetryOptions.url -}} + {{- .Values.telemetry.logger.opentelemetryOptions.url -}} +{{- end -}} +{{- end -}} + +{{/* +Renders a map of resource attributes as key=value,key=value for OTEL_RESOURCE_ATTRIBUTES. +Usage: {{ include "overseer.otelResourceAttributes" .resourceAttributes }} +*/}} +{{- define "overseer.otelResourceAttributes" -}} +{{- $attributes := list }} +{{- range $key, $value := . }} +{{- $attributes = append $attributes (printf "%s=%s" $key (toString $value)) }} +{{- end }} +{{- join "," $attributes }} +{{- end -}} diff --git a/helm/templates/_tplValues.tpl b/helm/templates/_tplValues.tpl index 3ea9860b..c8736809 100644 --- a/helm/templates/_tplValues.tpl +++ b/helm/templates/_tplValues.tpl @@ -46,14 +46,6 @@ Custom definitions */}} -{{- define "common.tracing.merged" -}} -{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.tracing .Values.global.tracing ) "context" . ) }} -{{- end -}} - -{{- define "common.openTelemetryOptions.merged" -}} -{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.env.openTelemetryOptions .Values.global.openTelemetryOptions ) "context" . ) }} -{{- end -}} - {{- define "common.serviceUrls.merged" -}} {{- include "common.tplvalues.merge" ( dict "values" ( list .Values.serviceUrls .Values.global.serviceUrls ) "context" . ) }} {{- end -}} diff --git a/helm/templates/configmap.yaml b/helm/templates/configmap.yaml index bac2296f..d855e439 100644 --- a/helm/templates/configmap.yaml +++ b/helm/templates/configmap.yaml @@ -1,6 +1,8 @@ {{- $configmapName := include "configmap.fullname" . }} -{{- $tracing := (include "common.tracing.merged" .) | fromYaml }} -{{- $openTelemetryOptions := (include "common.openTelemetryOptions.merged" .) | fromYaml }} +{{- $server := .Values.server -}} +{{- $telemetry := .Values.telemetry -}} +{{- $tracingUrl := include "overseer.tracingUrl" . -}} +{{- $opentelemetryLoggingUrl := include "overseer.opentelemetryLoggingUrl" . -}} {{- $serviceUrls := (include "common.serviceUrls.merged" .) | fromYaml }} {{- $storage := (include "common.storage.merged" .) | fromYaml }} {{- $jobDefinitions := (include "common.jobDefinitions.merged" .) | fromYaml }} @@ -11,21 +13,27 @@ kind: ConfigMap metadata: name: {{ $configmapName }} data: - REQUEST_PAYLOAD_LIMIT: {{ .Values.env.requestPayloadLimit | quote }} - RESPONSE_COMPRESSION_ENABLED: {{ .Values.env.responseCompressionEnabled | quote }} - LOG_LEVEL: {{ .Values.env.logLevel | quote }} - LOG_PRETTY_PRINT_ENABLED: {{ .Values.env.logPrettyPrintEnabled | quote }} - {{- with $openTelemetryOptions }} + {{- with $server }} + REQUEST_PAYLOAD_LIMIT: {{ .requestPayloadLimit | quote }} + RESPONSE_COMPRESSION_ENABLED: {{ .responseCompressionEnabled | quote }} + {{- end }} + {{- with $telemetry }} + LOG_LEVEL: {{ .logger.level | quote }} + LOG_PRETTY_PRINT_ENABLED: {{ .logger.prettyPrint | quote }} + {{- with .logger.opentelemetryOptions }} OPENTELEMETRY_LOGGING_ENABLED: {{ .enabled | quote }} - {{ if .enabled }} - OPENTELEMETRY_LOGGING_URL: {{ .url | quote }} - OPENTELEMETRY_RESOURCE_ATTRIBUTES: {{ .resourceAttributes | toJson | quote }} + {{- if .enabled }} + OTLP_LOGGER_ENDPOINT_URL: {{ $opentelemetryLoggingUrl | quote }} + {{- if .resourceAttributes }} + OTEL_RESOURCE_ATTRIBUTES: {{ include "overseer.otelResourceAttributes" .resourceAttributes | quote }} + {{- end }} + {{- end }} + {{- end }} + TELEMETRY_TRACING_ENABLED: {{ .tracing.enabled | quote }} + {{- if .tracing.enabled }} + TELEMETRY_TRACING_URL: {{ $tracingUrl | quote }} {{- end }} {{- end }} - TELEMETRY_TRACING_ENABLED: {{ $tracing.enabled | quote }} - {{ if $tracing.enabled }} - TELEMETRY_TRACING_URL: {{ $tracing.url }} - {{ end }} TELEMETRY_METRICS_BUCKETS: {{ .Values.mclabels.prometheus.buckets | toJson | quote }} {{- if eq (upper $storage.gpkgProvider) "S3" }} {{- $s3HttpProtocol := ternary "https://" "http://" $storage.s3.sslEnabled }} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index c00b4009..67fd0bb3 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -5,6 +5,7 @@ {{- $cloudProviderImagePullSecretName := include "overseer.cloudProviderImagePullSecretName" . -}} {{- $cloudProviderDockerRegistryUrl := include "overseer.cloudProviderDockerRegistryUrl" . -}} {{- $imageTag := include "overseer.tag" . -}} +{{- $server := .Values.server -}} {{- $storage := (include "common.storage.merged" .) | fromYaml }} {{- /* PVC handling - check if both PVCs point to the same claim */ -}} @@ -89,7 +90,7 @@ spec: fieldRef: fieldPath: metadata.uid - name: SERVER_PORT - value: {{ .Values.env.targetPort | quote }} + value: {{ $server.targetPort | quote }} {{- if .Values.global.ca.secretName }} - name: REQUESTS_CA_BUNDLE value: {{ printf "%s/%s" .Values.global.ca.path .Values.global.ca.key | quote }} @@ -116,8 +117,8 @@ spec: name: {{ $configmapName }} ports: - name: http - containerPort: {{ .Values.env.targetPort }} - protocol: {{ .Values.env.protocol }} + containerPort: {{ $server.targetPort }} + protocol: {{ $server.protocol }} {{- if .Values.livenessProbe.enabled }} livenessProbe: initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} @@ -125,7 +126,7 @@ spec: failureThreshold: {{ .Values.livenessProbe.failureThreshold }} httpGet: path: {{ .Values.livenessProbe.path }} - port: {{ .Values.env.targetPort }} + port: {{ $server.targetPort }} {{- end }} {{- if .Values.readinessProbe.enabled }} readinessProbe: @@ -134,7 +135,7 @@ spec: failureThreshold: {{ .Values.readinessProbe.failureThreshold }} httpGet: path: {{ .Values.readinessProbe.path }} - port: {{ .Values.env.targetPort }} + port: {{ $server.targetPort }} {{- end }} {{- if .Values.resources.enabled }} resources: diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml index 7c61b88f..c0afd2b0 100644 --- a/helm/templates/service.yaml +++ b/helm/templates/service.yaml @@ -2,6 +2,7 @@ {{- $chartName := include "overseer.name" . -}} {{- $cloudProviderFlavor := include "overseer.cloudProviderFlavor" . -}} {{- $serviceName := include "service.fullname" . -}} +{{- $server := .Values.server -}} {{- if .Values.enabled -}} apiVersion: v1 @@ -19,9 +20,9 @@ spec: type: NodePort {{- end }} ports: - - port: {{ .Values.env.port }} - targetPort: {{ .Values.env.targetPort }} - protocol: {{ .Values.env.protocol }} + - port: {{ $server.port }} + targetPort: {{ $server.targetPort }} + protocol: {{ $server.protocol }} name: http {{- if eq $cloudProviderFlavor "minikube" }} nodePort: {{ .Values.nodePort }} diff --git a/helm/values.yaml b/helm/values.yaml index cf3fb664..95018254 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -1,7 +1,9 @@ global: cloudProvider: {} - tracing: {} - openTelemetryOptions: {} + telemetry: + tracing: {} + logger: + opentelemetryOptions: {} environment: '' serviceUrls: {} jobDefinitions: {} @@ -186,19 +188,29 @@ jobDefinitions: intervalMs: 3000 maxTaskAttempts: 3 -env: +server: port: 8080 targetPort: 8080 protocol: TCP - logLevel: info - logPrettyPrintEnabled: false - openTelemetryOptions: - enabled: false - url: '' - resourceAttributes: {} responseCompressionEnabled: true requestPayloadLimit: 1mb +telemetry: + logger: + level: info + prettyPrint: false + opentelemetryOptions: + enabled: true + url: http://localhost:4317 + # Rendered as OTEL_RESOURCE_ATTRIBUTES in "key=value,key=value" format + # resourceAttributes: + # service.namespace: namespace + # deployment.environment: dev + tracing: + enabled: true + url: http://localhost:4318/v1/traces + +env: httpRetry: attempts: 5 delay: exponential From 248c65b5bbe0cabf5182302da4407989ebc3bae2 Mon Sep 17 00:00:00 2001 From: shlomiko Date: Thu, 10 Sep 2026 15:21:18 +0300 Subject: [PATCH 2/3] fix(helm): default pullPolicy to IfNotPresent and offlineMode to true Resolves the raster-export umbrella TODO overrides for exporter-overseer and drops the unused top-level tracing block superseded by telemetry.tracing. Co-Authored-By: Claude Fable 5.1 --- helm/values.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 95018254..d0c27527 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -108,7 +108,7 @@ cloudProvider: image: repository: overseer tag: 'latest' - pullPolicy: Always + pullPolicy: IfNotPresent serviceUrls: jobManager: "" @@ -122,12 +122,8 @@ serviceUrls: polygonPartsManager: "" downloadServerPublicDNS: "" -tracing: - enabled: false - url: "" - configManagement: - offlineMode: false + offlineMode: true name: 'overseer' version: 'latest' serverUrl: 'http://localhost:8080/api' From 3c4b6d63798852c537802600b50cef977b88db82 Mon Sep 17 00:00:00 2001 From: shlomiko Date: Tue, 15 Sep 2026 13:45:40 +0300 Subject: [PATCH 3/3] refactor: remove redundant prettyPrint option from logger configuration Aligns with ts-server-boilerplate#477: loggerConfig already carries prettyPrint, so spreading it is enough. Co-Authored-By: Claude Fable 5.1 --- src/containerConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containerConfig.ts b/src/containerConfig.ts index 5e18b8e3..d62c331b 100644 --- a/src/containerConfig.ts +++ b/src/containerConfig.ts @@ -121,7 +121,7 @@ export const registerExternalValues = async (options?: RegisterOptions): Promise const configInstance = getConfig(); const loggerConfig = configInstance.get('telemetry.logger'); - const logger = await jsLogger({ ...loggerConfig, prettyPrint: loggerConfig.prettyPrint, mixin: getOtelMixin() }); + const logger = await jsLogger({ ...loggerConfig, mixin: getOtelMixin() }); const metricsRegistry = new Registry(); configInstance.initializeMetrics(metricsRegistry);