Skip to content

Commit 11a3c44

Browse files
authored
Merge pull request #71 from rivToadd/auto-instrumentation-env-variables
feat: Adding instrumentation specific settings and adjust whitespacing
2 parents e4d3a60 + 7f6c142 commit 11a3c44

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

charts/kube-otel-stack/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: kube-otel-stack
33
description: Chart for sending Kubernetes metrics to Lightstep using the OpenTelemetry Operator.
44
type: application
5-
version: 0.4.0
5+
version: 0.4.1
66
appVersion: 0.91.0
77
dependencies:
88
# cert manager must be manually installed because it has CRDs
Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if .Values.autoinstrumentation.enabled }}
1+
{{- if .Values.autoinstrumentation.enabled }}
22
apiVersion: opentelemetry.io/v1alpha1
33
kind: Instrumentation
44
metadata:
@@ -7,17 +7,31 @@ spec:
77
exporter:
88
endpoint: http://{{ $.Release.Name }}-{{ .Values.autoinstrumentation.collectorTarget }}-collector.{{ $.Release.Namespace }}:4317
99
propagators:
10-
{{ toYaml .Values.autoinstrumentation.propagators | indent 4 }}
11-
{{ with .Values.autoinstrumentation.sampler }}
10+
{{- toYaml .Values.autoinstrumentation.propagators | nindent 4 }}
11+
{{- with .Values.autoinstrumentation.sampler }}
1212
sampler:
13-
{{ toYaml . | indent 4 }}
14-
{{ end }}
15-
{{ with .Values.autoinstrumentation.env }}
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
15+
{{- with .Values.autoinstrumentation.env }}
1616
env:
17-
{{ toYaml . | indent 4 }}
18-
{{ end }}
19-
{{ with .Values.autoinstrumentation.resource }}
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
19+
{{- with .Values.autoinstrumentation.resource }}
2020
resource:
21-
{{ toYaml . | indent 4 }}
22-
{{ end }}
23-
{{- end }}
21+
{{- toYaml . | nindent 4 }}
22+
{{- end }}
23+
{{- range $language, $settings := .Values.autoinstrumentation.languageSettings }}
24+
{{ $language }}:
25+
{{- with $settings.env }}
26+
env:
27+
{{- toYaml . | nindent 6 }}
28+
{{- end }}
29+
{{- if $settings.image }}
30+
image: {{ $settings.image | quote }}
31+
{{- end }}
32+
{{- with $settings.resources }}
33+
resources:
34+
{{- toYaml . | nindent 6 }}
35+
{{- end }}
36+
{{- end }}
37+
{{- end }}

charts/kube-otel-stack/values.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ autoinstrumentation:
3232
## The value depends on the sampler type.
3333
## For instance for parentbased_traceidratio sampler type it is a number in range [0..1] e.g. 0.25.
3434
argument: "0.25"
35-
35+
languageSettings: {}
36+
# LanguageSettings defines the language specific settings for auto-instrumentation. Example:
37+
# python:
38+
# env:
39+
# - name: OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED
40+
# value: "true"
41+
# - name: OTEL_TRACES_EXPORTER
42+
# value: "otlp"
43+
# image: "<custom-image>"
44+
# resources: {}
3645
## A list of corev1.EnvVars
3746
env: []
3847

0 commit comments

Comments
 (0)