From c1c6373ac44d4a554665f6f1a23aabce21024432 Mon Sep 17 00:00:00 2001 From: shlomiko Date: Wed, 9 Sep 2026 10:08:38 +0300 Subject: [PATCH 1/6] fix(helm): set configManagement.offlineMode default to true The raster-core umbrella chart overrides this value on every deployment. Make it the chart default so the override can be removed. --- helm/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/values.yaml b/helm/values.yaml index 36a3138..2d8a5c4 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -69,7 +69,7 @@ tracing: url: '' configManagement: - offlineMode: false + offlineMode: true name: 'job-tracker' version: 'latest' serverUrl: 'http://localhost:8080/api' From dc81ee97c0ff0de664677900f890ffd86462653d Mon Sep 17 00:00:00 2001 From: shlomiko Date: Thu, 10 Sep 2026 13:43:48 +0300 Subject: [PATCH 2/6] fix(helm): split env values into server and telemetry scopes Align the chart with ts-server-boilerplate: - replace the flat env block with a server scope (port, targetPort, protocol, requestPayloadLimit, responseCompressionEnabled) and a telemetry scope (logger, tracing) - rename logger keys to level and prettyPrint to match the config schema - export the otlp logger url as OTLP_LOGGER_ENDPOINT_URL and resource attributes as OTEL_RESOURCE_ATTRIBUTES in key=value,key=value format, the names the commonBoilerplateV3 schema and the OpenTelemetry SDK read - always export OPENTELEMETRY_LOGGING_ENABLED and TELEMETRY_TRACING_ENABLED with their value - move global overrides under global.telemetry; only the tracing and otlp logger urls are overridable from global and take precedence over chart values, enabled flags stay chart-level - drop the top-level tracing block, the unused env.queue values and the common.tracing.merged / common.openTelemetryOptions.merged helpers - reference $server / $telemetry via with blocks across the templates Co-Authored-By: Claude Fable 5.1 --- helm/templates/_helpers.tpl | 34 ++++++++++++++++++++++++++++ helm/templates/_tplValues.tpl | 8 ------- helm/templates/configmap.yaml | 37 +++++++++++++++++------------- helm/templates/deployment.yaml | 11 ++++----- helm/templates/ingress.yaml | 2 +- helm/templates/service.yaml | 7 +++--- helm/values.yaml | 41 +++++++++++++++++++++------------- 7 files changed, 92 insertions(+), 48 deletions(-) diff --git a/helm/templates/_helpers.tpl b/helm/templates/_helpers.tpl index dd09bc5..efb6f2c 100644 --- a/helm/templates/_helpers.tpl +++ b/helm/templates/_helpers.tpl @@ -106,3 +106,37 @@ Returns the cloud provider image pull secret name from global if exists or from {{- .Values.cloudProvider.imagePullSecretName -}} {{- end -}} {{- end -}} + +{{/* +Returns the tracing url from global if set, otherwise from the chart's values +*/}} +{{- define "job-tracker.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 "job-tracker.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 "job-tracker.otelResourceAttributes" .resourceAttributes }} +*/}} +{{- define "job-tracker.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 b10930c..0e4536c 100644 --- a/helm/templates/_tplValues.tpl +++ b/helm/templates/_tplValues.tpl @@ -53,14 +53,6 @@ Custom definitions {{- include "common.tplvalues.merge" ( dict "values" ( list .Values.jobDefinitions .Values.global.jobDefinitions ) "context" . ) }} {{- end -}} -{{- 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 -}} - {{/* Returns a yaml array of all the tasks types from jobDefinitions that has suspendJobOnFail: true */}} diff --git a/helm/templates/configmap.yaml b/helm/templates/configmap.yaml index cb9dfea..5841030 100644 --- a/helm/templates/configmap.yaml +++ b/helm/templates/configmap.yaml @@ -2,30 +2,37 @@ {{- $jobDefinitions := (include "common.jobDefinitions.merged" .) | fromYaml }} {{- $suspendingTaskTypes := include "suspendingTaskTypes" . }} {{- $serviceUrls := (include "common.serviceUrls.merged" .) | fromYaml }} -{{- $queue := .Values.env.queue }} -{{- $tracing := (include "common.tracing.merged" .) | fromYaml }} -{{- $openTelemetryOptions := (include "common.openTelemetryOptions.merged" .) | fromYaml }} +{{- $server := .Values.server -}} +{{- $telemetry := .Values.telemetry -}} +{{- $tracingUrl := include "job-tracker.tracingUrl" . -}} +{{- $opentelemetryLoggingUrl := include "job-tracker.opentelemetryLoggingUrl" . -}} {{- if .Values.enabled -}} apiVersion: v1 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 "job-tracker.otelResourceAttributes" .resourceAttributes | quote }} + {{- end }} + {{- end }} + {{- end }} + TELEMETRY_TRACING_ENABLED: {{ .tracing.enabled | quote }} + {{- if .tracing.enabled }} + TELEMETRY_TRACING_URL: {{ $tracingUrl | quote }} {{- end }} {{- end }} - {{ if $tracing.enabled }} - TELEMETRY_TRACING_ENABLED: 'true' - TELEMETRY_TRACING_URL: {{ $tracing.url }} - {{ end }} npm_config_cache: /tmp/ JOB_MANAGER_BASE_URL: {{ $serviceUrls.jobManager | quote }} JOB_DEFINITIONS_JOB_NEW: {{ $jobDefinitions.jobs.new.type | quote }} diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index c57f39b..116ae06 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -6,6 +6,7 @@ {{- $cloudProviderDockerRegistryUrl := include "job-tracker.cloudProviderDockerRegistryUrl" . -}} {{- $cloudProviderImagePullSecretName := include "job-tracker.cloudProviderImagePullSecretName" . -}} {{- $imageTag := include "job-tracker.tag" . -}} +{{- $server := .Values.server -}} {{- if .Values.enabled -}} apiVersion: apps/v1 kind: Deployment @@ -71,7 +72,7 @@ spec: {{- end }} env: - name: SERVER_PORT - value: {{ .Values.env.targetPort | quote }} + value: {{ $server.targetPort | quote }} - name: K8S_POD_UID valueFrom: fieldRef: @@ -90,8 +91,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 }} @@ -99,7 +100,7 @@ spec: failureThreshold: {{ .Values.livenessProbe.failureThreshold }} httpGet: path: {{ .Values.livenessProbe.path }} - port: {{ .Values.env.targetPort }} + port: {{ $server.targetPort }} {{- end }} {{- if .Values.readinessProbe.enabled }} readinessProbe: @@ -108,7 +109,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/ingress.yaml b/helm/templates/ingress.yaml index 59800c6..981472f 100644 --- a/helm/templates/ingress.yaml +++ b/helm/templates/ingress.yaml @@ -32,6 +32,6 @@ spec: service: name: {{ $serviceName }} port: - number: {{ .Values.env.port }} + number: {{ .Values.server.port }} host: {{ $ingressHost }} {{- end -}} diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml index 8e0c78d..49c4aed 100644 --- a/helm/templates/service.yaml +++ b/helm/templates/service.yaml @@ -2,6 +2,7 @@ {{- $chartName := include "job-tracker.name" . -}} {{- $cloudProviderFlavor := include "job-tracker.cloudProviderFlavor" . -}} {{- $serviceName := include "service.fullname" . -}} +{{- $server := .Values.server -}} {{- if .Values.enabled -}} apiVersion: v1 kind: Service @@ -18,9 +19,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 2d8a5c4..b11c484 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -1,10 +1,12 @@ global: cloudProvider: {} - tracing: {} + telemetry: + tracing: {} + logger: + opentelemetryOptions: {} environment: '' jobDefinitions: {} serviceUrls: {} - openTelemetryOptions: {} ca: secretName: '' path: '/usr/local/share/ca-certificates' @@ -64,10 +66,6 @@ cloudProvider: imagePullSecretName: '' flavor: openshift -tracing: - enabled: false - url: '' - configManagement: offlineMode: true name: 'job-tracker' @@ -137,21 +135,32 @@ taskFlowManager: deleteLayerTasksFlow: - delete - tiles-deletion -env: +server: port: 80 targetPort: 8080 protocol: TCP - logLevel: info - logPrettyPrintEnabled: false - openTelemetryOptions: - enabled: false - url: '' - resourceAttributes: {} responseCompressionEnabled: true requestPayloadLimit: 1mb - queue: - dequeueIntervalMs: 3000 - heartbeatIntervalMs: 3000 + +telemetry: + logger: + level: info + prettyPrint: false + # OpenTelemetry logging. Rendered into the configmap as OPENTELEMETRY_LOGGING_ENABLED, + # OTLP_LOGGER_ENDPOINT_URL and, when resourceAttributes is set, OTEL_RESOURCE_ATTRIBUTES + # as a key=value,key=value list. All three are mapped in + # config/custom-environment-variables.json. + # url can be overridden from global.telemetry.logger.opentelemetryOptions.url. + 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:55681/v1/traces resources: enabled: false From 0c1b840e3b2cfffaf5571753c29938dec715afc7 Mon Sep 17 00:00:00 2001 From: shlomiko Date: Thu, 10 Sep 2026 13:43:48 +0300 Subject: [PATCH 3/6] fix(config): map otlp logger url and resource attributes from the new env names Read telemetry.logger.opentelemetryOptions.url from OTLP_LOGGER_ENDPOINT_URL and resourceAttributes from OTEL_RESOURCE_ATTRIBUTES, matching the helm configmap and the commonBoilerplateV3 schema. Co-Authored-By: Claude Fable 5.1 --- config/custom-environment-variables.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config/custom-environment-variables.json b/config/custom-environment-variables.json index e527ae7..7544482 100644 --- a/config/custom-environment-variables.json +++ b/config/custom-environment-variables.json @@ -15,11 +15,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" } }, "tracing": { From e3f39eca27f376eea7033ee4bd6cbd672fd3839b Mon Sep 17 00:00:00 2001 From: shlomiko Date: Thu, 10 Sep 2026 14:31:22 +0300 Subject: [PATCH 4/6] style(helm): separate server scope with a blank line Co-Authored-By: Claude Fable 5.1 --- helm/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/helm/values.yaml b/helm/values.yaml index b11c484..e3dd3c0 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -135,6 +135,7 @@ taskFlowManager: deleteLayerTasksFlow: - delete - tiles-deletion + server: port: 80 targetPort: 8080 From 35aafe0687772a79b2c20ad15cdbc56d391b507f Mon Sep 17 00:00:00 2001 From: shlomiko Date: Thu, 10 Sep 2026 14:48:56 +0300 Subject: [PATCH 5/6] style(helm): drop the opentelemetryOptions explanatory comment Co-Authored-By: Claude Fable 5.1 --- helm/values.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index e3dd3c0..0971fc9 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -147,11 +147,6 @@ telemetry: logger: level: info prettyPrint: false - # OpenTelemetry logging. Rendered into the configmap as OPENTELEMETRY_LOGGING_ENABLED, - # OTLP_LOGGER_ENDPOINT_URL and, when resourceAttributes is set, OTEL_RESOURCE_ATTRIBUTES - # as a key=value,key=value list. All three are mapped in - # config/custom-environment-variables.json. - # url can be overridden from global.telemetry.logger.opentelemetryOptions.url. opentelemetryOptions: enabled: true url: http://localhost:4317 From 1ab621bfc7777ba7fcc06214052a13576fae8c80 Mon Sep 17 00:00:00 2001 From: shlomiko Date: Tue, 15 Sep 2026 13:45:30 +0300 Subject: [PATCH 6/6] 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 5f2cbb3..78d6941 100644 --- a/src/containerConfig.ts +++ b/src/containerConfig.ts @@ -41,7 +41,7 @@ export const registerExternalValues = async (options?: RegisterOptions): Promise const loggerConfig = configInstance.get('telemetry.logger'); - const logger = await jsLogger({ ...loggerConfig, prettyPrint: loggerConfig.prettyPrint, mixin: getOtelMixin() }); + const logger = await jsLogger({ ...loggerConfig, mixin: getOtelMixin() }); const tracer = trace.getTracer(SERVICE_NAME); const metricsRegistry = new Registry();