Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
36 changes: 35 additions & 1 deletion helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
{{- 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 -}}
8 changes: 0 additions & 8 deletions helm/templates/_tplValues.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
36 changes: 22 additions & 14 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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 }}
Expand Down
11 changes: 6 additions & 5 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 */ -}}
Expand Down Expand Up @@ -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 }}
Expand All @@ -116,16 +117,16 @@ 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 }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
httpGet:
path: {{ .Values.livenessProbe.path }}
port: {{ .Values.env.targetPort }}
port: {{ $server.targetPort }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
Expand All @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{{- $chartName := include "overseer.name" . -}}
{{- $cloudProviderFlavor := include "overseer.cloudProviderFlavor" . -}}
{{- $serviceName := include "service.fullname" . -}}
{{- $server := .Values.server -}}

{{- if .Values.enabled -}}
apiVersion: v1
Expand All @@ -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 }}
Expand Down
38 changes: 23 additions & 15 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
global:
cloudProvider: {}
tracing: {}
openTelemetryOptions: {}
telemetry:
tracing: {}
logger:
opentelemetryOptions: {}
environment: ''
serviceUrls: {}
jobDefinitions: {}
Expand Down Expand Up @@ -106,7 +108,7 @@ cloudProvider:
image:
repository: overseer
tag: 'latest'
pullPolicy: Always
pullPolicy: IfNotPresent

serviceUrls:
jobManager: ""
Expand All @@ -120,12 +122,8 @@ serviceUrls:
polygonPartsManager: ""
downloadServerPublicDNS: ""

tracing:
enabled: false
url: ""

configManagement:
offlineMode: false
offlineMode: true
name: 'overseer'
version: 'latest'
serverUrl: 'http://localhost:8080/api'
Expand Down Expand Up @@ -186,19 +184,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
Expand Down
2 changes: 1 addition & 1 deletion src/containerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading