Skip to content

Commit

Permalink
Merge pull request #71 from rivToadd/auto-instrumentation-env-variables
Browse files Browse the repository at this point in the history
feat: Adding instrumentation specific settings and adjust whitespacing
  • Loading branch information
jaronoff97 authored Feb 26, 2024
2 parents e4d3a60 + 7f6c142 commit 11a3c44
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
2 changes: 1 addition & 1 deletion charts/kube-otel-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: kube-otel-stack
description: Chart for sending Kubernetes metrics to Lightstep using the OpenTelemetry Operator.
type: application
version: 0.4.0
version: 0.4.1
appVersion: 0.91.0
dependencies:
# cert manager must be manually installed because it has CRDs
Expand Down
38 changes: 26 additions & 12 deletions charts/kube-otel-stack/templates/autoinstrumentation.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if .Values.autoinstrumentation.enabled }}
{{- if .Values.autoinstrumentation.enabled }}
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
Expand All @@ -7,17 +7,31 @@ spec:
exporter:
endpoint: http://{{ $.Release.Name }}-{{ .Values.autoinstrumentation.collectorTarget }}-collector.{{ $.Release.Namespace }}:4317
propagators:
{{ toYaml .Values.autoinstrumentation.propagators | indent 4 }}
{{ with .Values.autoinstrumentation.sampler }}
{{- toYaml .Values.autoinstrumentation.propagators | nindent 4 }}
{{- with .Values.autoinstrumentation.sampler }}
sampler:
{{ toYaml . | indent 4 }}
{{ end }}
{{ with .Values.autoinstrumentation.env }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.autoinstrumentation.env }}
env:
{{ toYaml . | indent 4 }}
{{ end }}
{{ with .Values.autoinstrumentation.resource }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.autoinstrumentation.resource }}
resource:
{{ toYaml . | indent 4 }}
{{ end }}
{{- end }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- range $language, $settings := .Values.autoinstrumentation.languageSettings }}
{{ $language }}:
{{- with $settings.env }}
env:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if $settings.image }}
image: {{ $settings.image | quote }}
{{- end }}
{{- with $settings.resources }}
resources:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
11 changes: 10 additions & 1 deletion charts/kube-otel-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@ autoinstrumentation:
## The value depends on the sampler type.
## For instance for parentbased_traceidratio sampler type it is a number in range [0..1] e.g. 0.25.
argument: "0.25"

languageSettings: {}
# LanguageSettings defines the language specific settings for auto-instrumentation. Example:
# python:
# env:
# - name: OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED
# value: "true"
# - name: OTEL_TRACES_EXPORTER
# value: "otlp"
# image: "<custom-image>"
# resources: {}
## A list of corev1.EnvVars
env: []

Expand Down

0 comments on commit 11a3c44

Please sign in to comment.