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 @@ -17,11 +17,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": {
Expand Down
33 changes: 33 additions & 0 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,36 @@ Returns the cloud provider image pull secret name from global if exists or from
{{- end -}}
{{- end -}}

{{/*
Returns the tracing url from global if set, otherwise from the chart's values
*/}}
{{- define "ingestion-trigger.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 "ingestion-trigger.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 "ingestion-trigger.otelResourceAttributes" .resourceAttributes }}
*/}}
{{- define "ingestion-trigger.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 @@ -64,11 +64,3 @@ Custom definitions
{{- define "common.ingestion.merged" -}}
{{- include "common.tplvalues.merge" ( dict "values" ( list .Values.ingestion .Values.global.ingestion ) "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 -}}
44 changes: 25 additions & 19 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- $chartName := include "ingestion-trigger.name" . -}}
{{- $configmapName := include "configmap.fullname" . }}
{{- $tracing := (include "common.tracing.merged" .) | fromYaml }}
{{- $openTelemetryOptions := (include "common.openTelemetryOptions.merged" .) | fromYaml }}
{{- $server := .Values.server -}}
{{- $telemetry := .Values.telemetry -}}
{{- $tracingUrl := include "ingestion-trigger.tracingUrl" . -}}
{{- $opentelemetryLoggingUrl := include "ingestion-trigger.opentelemetryLoggingUrl" . -}}
{{- $serviceUrls := (include "common.serviceUrls.merged" .) | fromYaml }}
{{- $jobDefinitions := (include "common.jobDefinitions.merged" .) | fromYaml }}
{{- $storage := (include "common.storage.merged" .) | fromYaml }}
Expand All @@ -12,10 +14,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 $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 }}
OTLP_LOGGER_ENDPOINT_URL: {{ $opentelemetryLoggingUrl | quote }}
{{- if .resourceAttributes }}
OTEL_RESOURCE_ATTRIBUTES: {{ include "ingestion-trigger.otelResourceAttributes" .resourceAttributes | quote }}
{{- end }}
{{- end }}
{{- end }}
TELEMETRY_TRACING_ENABLED: {{ .tracing.enabled | quote }}
{{- if .tracing.enabled }}
TELEMETRY_TRACING_URL: {{ $tracingUrl | quote }}
{{- end }}
{{- end }}
JOB_DOMAIN: {{ .Values.global.domain | quote }}
PRODUCT_READER_MAX_VERTICES_PER_CHUNK: {{ .Values.env.productReader.maxVerticesPerChunk | quote }}
JOB_MANAGER_URL: {{ $serviceUrls.jobManager | quote }}
Expand Down Expand Up @@ -46,19 +65,6 @@ data:
TILE_SIZE: {{ .Values.env.validationValuesByInfo.tileSize | quote}}
RESOLUTION_FIXED_POINT_TOLERANCE: {{ .Values.env.validationValuesByInfo.resolutionFixedPointTolerance | quote }}
EXTENT_BUFFER_IN_METERS: {{ .Values.env.validationValuesByInfo.extentBufferInMeters | quote }}
TELEMETRY_TRACING_ENABLED: {{ $tracing.enabled | quote }}
{{ if $tracing.enabled }}
TELEMETRY_TRACING_URL: {{ $tracing.url }}
{{ end }}
{{- with $openTelemetryOptions }}
OPENTELEMETRY_LOGGING_ENABLED: {{ .enabled | quote }}
{{ if .enabled }}
OPENTELEMETRY_LOGGING_URL: {{ .url | quote }}
{{ if .resourceAttributes }}
OPENTELEMETRY_RESOURCE_ATTRIBUTES: {{ .resourceAttributes | toJson | quote }}
{{ end }}
{{ end }}
{{- end }}
{{- with .Values.configManagement }}
CONFIG_SERVER_URL: {{ .serverUrl | quote }}
CONFIG_NAME: {{ .name | quote }}
Expand Down
8 changes: 4 additions & 4 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
fieldRef:
fieldPath: metadata.uid
- name: SERVER_PORT
value: {{ .Values.env.targetPort | quote }}
value: {{ .Values.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 @@ -82,13 +82,13 @@ spec:
name: {{ $configmapName }}
ports:
- name: http
containerPort: {{ .Values.env.targetPort }}
protocol: {{ .Values.env.protocol }}
containerPort: {{ .Values.server.targetPort }}
protocol: {{ .Values.server.protocol }}
livenessProbe:
initialDelaySeconds: {{ .Values.initialDelaySeconds }}
httpGet:
path: /liveness
port: {{ .Values.env.targetPort }}
port: {{ .Values.server.targetPort }}
{{- if .Values.resources.enabled }}
resources:
{{- toYaml .Values.resources.value | nindent 12 }}
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ spec:
service:
name: {{ $serviceName }}
port:
number: {{ .Values.env.port }}
number: {{ .Values.server.port }}
host: {{ $ingressHost }}
{{- end -}}
6 changes: 3 additions & 3 deletions helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ spec:
type: NodePort
{{- end }}
ports:
- port: {{ .Values.env.port }}
targetPort: {{ .Values.env.targetPort }}
protocol: {{ .Values.env.protocol }}
- port: {{ .Values.server.port }}
targetPort: {{ .Values.server.targetPort }}
protocol: {{ .Values.server.protocol }}
name: http
{{- if eq $cloudProviderFlavor "minikube" }}
nodePort: {{ .Values.nodePort }}
Expand Down
43 changes: 23 additions & 20 deletions helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
global:
cloudProvider: {}
tracing: {}
telemetry:
tracing: {}
logger:
opentelemetryOptions: {}
environment: ''
domain: "RASTER"
serviceUrls: {}
openTelemetryOptions:
enabled: false
url: ''
resourceAttributes: {}
jobDefinitions: {}
storage:
fs:
Expand Down Expand Up @@ -39,7 +38,7 @@ revisionHistoryLimit: 5 # Amount of revisions we keep
initialDelaySeconds: 60
nodePort: 30030 #for minikube deployment only
resetOnConfigChange: true
imagePullPolicy: Always
imagePullPolicy: IfNotPresent

serviceUrls:
mapproxyApi: ""
Expand Down Expand Up @@ -77,12 +76,8 @@ cloudProvider:
imagePullSecretName: 'my-registry-secret'
flavor: openshift

tracing:
enabled: false
url: ''

configManagement:
offlineMode: false
offlineMode: true
name: 'ingestion-trigger'
version: 'latest'
serverUrl: 'http://localhost:8080/api'
Expand Down Expand Up @@ -128,21 +123,29 @@ caSecretName: ''
caPath: '/usr/local/share/ca-certificates'
caKey: 'ca.crt'

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: false
url: ''
enabled: true
url: http://localhost:55681/v1/traces

env:
storageExplorer:
layerSourceDir: '/layerSources'
displayNameDir: "\\layerSources"
Expand Down
2 changes: 1 addition & 1 deletion src/containerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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();
Expand Down
Loading