Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(instrumentation): move instrumentation configuration from opentelemetry-operator #3733

Merged
merged 12 commits into from
Jun 13, 2024
32 changes: 32 additions & 0 deletions .changelog/3733.breaking.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
chore(instrumentation): move instrumentation configuration from opentelemetry-operator values

#### Moved:
* From `opentelemetry-operator.instrumentationJobImage` to `instrumentation.instrumentationJobImage`
* From `opentelemetry-operator.createDefaultInstrumentation` to `instrumentation.createDefaultInstrumentation`
* From `opentelemetry-operator.instrumentationNamespaces` to `instrumentation.instrumentationNamespaces`
* From `opentelemetry-operator.instrumentation.dotnet.traces` to `instrumentation.dotnet.traces`
* From `opentelemetry-operator.instrumentation.dotnet.metrics` to `instrumentation.dotnet.metrics`
* From `opentelemetry-operator.instrumentation.dotnet.extraEnvVars` to `instrumentation.dotnet.extraEnvVars`
* From `opentelemetry-operator.instrumentation.java.traces` to `instrumentation.java.traces`
* From `opentelemetry-operator.instrumentation.java.metrics` to `instrumentation.java.metrics`
* From `opentelemetry-operator.instrumentation.java.extraEnvVars` to `instrumentation.java.extraEnvVars`
* From `opentelemetry-operator.instrumentation.nodejs` to `instrumentation.nodejs`
* From `opentelemetry-operator.instrumentation.python.traces` to `instrumentation.python.traces`
* From `opentelemetry-operator.instrumentation.python.metrics` to `instrumentation.python.metrics`
* From `opentelemetry-operator.instrumentation.python.extraEnvVars` to `instrumentation.python.extraEnvVars`

#### Changed:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between moved and changed?

Copy link
Contributor Author

@mat-rumian mat-rumian May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved are the keys moved from opentelemetry-operator key to instrumentation. Changed are keys which stay in the opentelemetry-operator but in different place (if it makes sense :))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense, but not sure if the distinguishment is significant and needed for customer

* From `opentelemetry-operator.instrumentation.dotnet.repository` to `opentelemetry-operator.autoInstrumentationImage.dotnet.repository`
* From `opentelemetry-operator.instrumentation.dotnet.tag` to `opentelemetry-operator.autoInstrumentationImage.dotnet.tag`
* From `opentelemetry-operator.instrumentation.java.repository` to `opentelemetry-operator.autoInstrumentationImage.java.repository`
* From `opentelemetry-operator.instrumentation.java.tag` to `opentelemetry-operator.autoInstrumentationImage.java.tag`
* From `opentelemetry-operator.instrumentation.nodejs.repository` to `opentelemetry-operator.autoInstrumentationImage.nodejs.repository`
* From `opentelemetry-operator.instrumentation.nodejs.tag` to `opentelemetry-operator.autoInstrumentationImage.nodejs.tag`
* From `opentelemetry-operator.instrumentation.python.repository` to `opentelemetry-operator.autoInstrumentationImage.python.repository`
* From `opentelemetry-operator.instrumentation.python.tag` to `opentelemetry-operator.autoInstrumentationImage.python.tag`

#### Deleted:
* `opentelemetry-operator.instrumentation.dotnet.image`
* `opentelemetry-operator.instrumentation.java.image`
* `opentelemetry-operator.instrumentation.nodejs.image`
* `opentelemetry-operator.instrumentation.python.image`
8 changes: 4 additions & 4 deletions ci/check_configuration_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
'metadata.metrics.statefulset.extraVolumeMounts',
'metadata.metrics.statefulset.extraVolumes',
'metadata.persistence.storageClass',
'opentelemetry-operator.instrumentation.dotnet.extraEnvVars',
'opentelemetry-operator.instrumentation.java.extraEnvVars',
'opentelemetry-operator.instrumentation.python.extraEnvVars',
'opentelemetry-operator.instrumentation.nodejs.extraEnvVars',
'instrumentation.dotnet.extraEnvVars',
'instrumentation.java.extraEnvVars',
'instrumentation.python.extraEnvVars',
'instrumentation.nodejs.extraEnvVars',
'otelcolInstrumentation.statefulset.priorityClassName',
'otelcolInstrumentation.statefulset.extraEnvVars',
'otelcolInstrumentation.statefulset.extraVolumeMounts',
Expand Down
49 changes: 23 additions & 26 deletions deploy/helm/sumologic/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
{{- $ctx := . -}}
{{- $operator := index .Values "opentelemetry-operator" -}}
{{- if eq ( get $operator "instrumentationNamespaces" ) "" -}}
{{ fail "No value for \"opentelemetry-operator.instrumentationNamespaces\".Value is comma separated namespaces e.g. \"ns1\\,ns2\"" }}
{{- $instrumentation := .Values.instrumentation -}}
{{- $operatorAiImages := index .Values "opentelemetry-operator" "manager" "autoInstrumentationImage" -}}
{{- if eq ( get $instrumentation "instrumentationNamespaces" ) "" -}}
{{ fail "No value for \"instrumentation.instrumentationNamespaces\".Value is comma separated namespaces e.g. \"ns1\\,ns2\"" }}
{{- else -}}
{{- range $ns := splitList "," $operator.instrumentationNamespaces -}}
{{- $dotnetImage := printf "%s:%s" $operator.instrumentation.dotnet.repository $operator.instrumentation.dotnet.tag -}}
{{- if $operator.instrumentation.dotnet.image -}}
{{- $dotnetImage = $operator.instrumentation.dotnet.image -}}
{{- end -}}
{{- $pythonImage := printf "%s:%s" $operator.instrumentation.python.repository $operator.instrumentation.python.tag -}}
{{- if $operator.instrumentation.python.image -}}
{{- $pythonImage = $operator.instrumentation.python.image -}}
{{- end -}}
{{- $nodeJSImage := printf "%s:%s" $operator.instrumentation.nodejs.repository $operator.instrumentation.nodejs.tag -}}
{{- if $operator.instrumentation.nodejs.image -}}
{{- $nodeJSImage = $operator.instrumentation.nodejs.image -}}
{{- end -}}
{{- $javaImage := printf "%s:%s" $operator.instrumentation.java.repository $operator.instrumentation.java.tag -}}
{{- if $operator.instrumentation.java.image -}}
{{- $javaImage = $operator.instrumentation.java.image -}}
{{- end -}}
{{- range $ns := splitList "," $instrumentation.instrumentationNamespaces -}}
{{- $dotnetImage := printf "%s:%s" $operatorAiImages.dotnet.repository $operatorAiImages.dotnet.tag -}}
{{- $pythonImage := printf "%s:%s" $operatorAiImages.python.repository $operatorAiImages.python.tag -}}
{{- $nodeJSImage := printf "%s:%s" $operatorAiImages.nodejs.repository $operatorAiImages.nodejs.tag -}}
{{- $javaImage := printf "%s:%s" $operatorAiImages.java.repository $operatorAiImages.java.tag -}}
---
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
Expand All @@ -44,53 +33,55 @@ spec:
image: {{ $dotnetImage }}
env:
- name: OTEL_METRICS_EXPORTER
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $operator.instrumentation.dotnet.metrics.enabled) }}
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $instrumentation.dotnet.metrics.enabled) }}
- name: OTEL_LOGS_EXPORTER
value: none
- name: OTEL_TRACES_EXPORTER
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $operator.instrumentation.dotnet.traces.enabled) }}
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $instrumentation.dotnet.traces.enabled) }}
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: http/protobuf
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://{{- include "sumologic.opentelemetry.operator.instrumentation.collector.endpoint" $ctx }}:4318
{{- if $operator.instrumentation.dotnet.extraEnvVars -}}
{{- toYaml $operator.instrumentation.dotnet.extraEnvVars | nindent 6 -}}
{{- if $instrumentation.dotnet.extraEnvVars -}}
{{- toYaml $instrumentation.dotnet.extraEnvVars | nindent 6 -}}
{{- end }}
python:
image: {{ $pythonImage }}
env:
- name: OTEL_METRICS_EXPORTER
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $operator.instrumentation.python.metrics.enabled) }}
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $instrumentation.python.metrics.enabled) }}
- name: OTEL_TRACES_EXPORTER
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $operator.instrumentation.python.traces.enabled) }}
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $instrumentation.python.traces.enabled) }}
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: http/protobuf
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://{{- include "sumologic.opentelemetry.operator.instrumentation.collector.endpoint" $ctx }}:4318
{{- if $operator.instrumentation.python.extraEnvVars -}}
{{- toYaml $operator.instrumentation.python.extraEnvVars | nindent 6 -}}
{{- if $instrumentation.python.extraEnvVars -}}
{{- toYaml $instrumentation.python.extraEnvVars | nindent 6 -}}
{{- end }}
nodejs:
image: {{ $nodeJSImage }}
env:
- name: OTEL_METRICS_EXPORTER
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $instrumentation.nodejs.metrics.enabled) }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://{{- include "sumologic.opentelemetry.operator.instrumentation.collector.endpoint" $ctx }}:4317
{{- if $operator.instrumentation.nodejs.extraEnvVars -}}
{{- toYaml $operator.instrumentation.nodejs.extraEnvVars | nindent 6 -}}
{{- if $instrumentation.nodejs.extraEnvVars -}}
{{- toYaml $instrumentation.nodejs.extraEnvVars | nindent 6 -}}
{{- end }}
java:
image: {{ $javaImage }}
env:
- name: OTEL_METRICS_EXPORTER
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $operator.instrumentation.java.metrics.enabled) }}
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $instrumentation.java.metrics.enabled) }}
- name: OTEL_TRACES_EXPORTER
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $operator.instrumentation.java.traces.enabled) }}
value: {{ include "instrumentation.resource.exporter" (dict "enabled" $instrumentation.java.traces.enabled) }}
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: http/protobuf
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://{{- include "sumologic.opentelemetry.operator.instrumentation.collector.endpoint" $ctx }}:4318
{{- if $operator.instrumentation.java.extraEnvVars -}}
{{- toYaml $operator.instrumentation.java.extraEnvVars | nindent 6 -}}
{{- if $instrumentation.java.extraEnvVars -}}
{{- toYaml $instrumentation.java.extraEnvVars | nindent 6 -}}
{{- end }}
{{ end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ $operatorEnabled := index .Values "opentelemetry-operator" "enabled" }}
{{ $tracesEnabled := .Values.sumologic.traces.enabled }}
{{ $createDefaultInstrumentation := index .Values "opentelemetry-operator" "createDefaultInstrumentation" }}
{{ $createDefaultInstrumentation := .Values.instrumentation.createDefaultInstrumentation }}
{{- if and $operatorEnabled $tracesEnabled $createDefaultInstrumentation }}
apiVersion: v1
kind: ConfigMap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- $ctx := . }}
{{ $operatorEnabled := index .Values "opentelemetry-operator" "enabled" }}
{{ $tracesEnabled := .Values.sumologic.traces.enabled }}
{{ $createDefaultInstrumentation := index .Values "opentelemetry-operator" "createDefaultInstrumentation" }}
{{ $createDefaultInstrumentation := .Values.instrumentation.createDefaultInstrumentation }}
{{- if and $operatorEnabled $tracesEnabled $createDefaultInstrumentation }}
{{ $instrumentationJobImage := index .Values "opentelemetry-operator" "instrumentationJobImage" "image" }}
{{ $instrumentationJobImage := .Values.instrumentation.instrumentationJobImage.image }}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down
138 changes: 66 additions & 72 deletions deploy/helm/sumologic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2463,78 +2463,6 @@ tailing-sidecar-operator:
opentelemetry-operator:
enabled: true

## Specific for Sumo Logic chart - Instrumentation resource creation
instrumentationJobImage:
image:
repository: public.ecr.aws/sumologic/kubernetes-tools-kubectl
tag: 2.22.0

createDefaultInstrumentation: false
instrumentationNamespaces: ""

instrumentation:
dotnet:
repository: public.ecr.aws/sumologic/autoinstrumentation-dotnet
tag: 0.7.0

## image is deprecated, it should be specified in ${repository}:${tag} format
image: ""
traces:
enabled: true
metrics:
enabled: true

## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

java:
repository: public.ecr.aws/sumologic/autoinstrumentation-java
tag: 1.26.0

## image is deprecated, it should be specified in ${repository}:${tag} format
image: ""
traces:
enabled: true
metrics:
enabled: true

## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

python:
repository: public.ecr.aws/sumologic/autoinstrumentation-python
tag: 0.39b0

## image is deprecated, it should be specified in ${repository}:${tag} format
image: ""
traces:
enabled: true
metrics:
enabled: true

## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

## Current instrumentation doesn't support customization
## for nodejs. Traces are always enabled.
nodejs:
repository: public.ecr.aws/sumologic/autoinstrumentation-nodejs
tag: 0.40.0

## image is deprecated, it should be specified in ${repository}:${tag} format
image: ""

## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

## Specific for OpenTelemetry Operator chart values
admissionWebhooks:
failurePolicy: Fail
Expand All @@ -2557,6 +2485,19 @@ opentelemetry-operator:
collectorImage:
repository: "public.ecr.aws/sumologic/sumologic-otel-collector"
tag: "0.102.1-sumo-0"
autoInstrumentationImage:
java:
repository: public.ecr.aws/sumologic/autoinstrumentation-java
tag: 1.26.0
dotnet:
repository: public.ecr.aws/sumologic/autoinstrumentation-dotnet
tag: 0.7.0
python:
repository: public.ecr.aws/sumologic/autoinstrumentation-python
tag: 0.39b0
nodejs:
repository: public.ecr.aws/sumologic/autoinstrumentation-nodejs
tag: 0.40.0
env:
{}
# ENABLE_WEBHOOKS: "true"
Expand Down Expand Up @@ -2621,6 +2562,59 @@ pvcCleaner:
securityContext:
runAsUser: 1000

## Configure instrumentation for OpenTelemetry-Operator
instrumentation:
## Specific for Sumo Logic chart - Instrumentation resource creation
instrumentationJobImage:
image:
repository: public.ecr.aws/sumologic/kubernetes-tools-kubectl
tag: 2.22.0

createDefaultInstrumentation: false
instrumentationNamespaces: ""

dotnet:
traces:
enabled: true
metrics:
enabled: true
## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

java:
traces:
enabled: true
metrics:
enabled: true

## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

python:
traces:
enabled: true
metrics:
enabled: true

## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

## Current instrumentation doesn't support customization
## for nodejs traces are always enabled.
nodejs:
metrics:
enabled: true
## Extra Environment Values - allows yaml definitions
# extraEnvVars:
# - name: OTEL_CUSTOM_ENV_VAR
# value: my_value

## The following section is not a subject of standard support scope and should be considered experimental
## All of them are meant for debugging purposed and shouldn't be used on production environments
debug:
Expand Down
Loading
Loading