diff --git a/.changelog/3733.breaking.txt b/.changelog/3733.breaking.txt new file mode 100644 index 0000000000..9737033c41 --- /dev/null +++ b/.changelog/3733.breaking.txt @@ -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: +* 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` diff --git a/ci/check_configuration_keys.py b/ci/check_configuration_keys.py index cc253d0bef..b29f35cc6c 100755 --- a/ci/check_configuration_keys.py +++ b/ci/check_configuration_keys.py @@ -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', diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index e70550598b..759ebf1824 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -295,29 +295,26 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `telegraf-operator.image.sidecarImage` | Telegraf Operator sidecar image. | `public.ecr.aws/sumologic/telegraf:1.21.2` | | `telegraf-operator.imagePullSecrets` | Pull secrets for Telegraf Operator images. For more information on using Kubernetes secrets with container registries please refer to [Creating a Secret with a Docker config at kubernetes.io](https://kubernetes.io/docs/concepts/containers/images/#creating-a-secret-with-a-docker-config). | `[]` | | `opentelemetry-operator.enabled` | Flag to control deploying OpenTelemetry Operator Helm sub-chart. | `true` | -| `opentelemetry-operator.createDefaultInstrumentation` | Flag to control creation of default Instrumentation object | `false` | -| `opentelemetry-operator.instrumentation.dotnet.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | -| `opentelemetry-operator.instrumentation.dotnet.repository` | OpenTelemetry Operator DotNet Instrumentation iamfge repository. | `public.ecr.aws/sumologic/autoinstrumentation-dotnet` | -| `opentelemetry-operator.instrumentation.dotnet.tag` | OpenTelemetry Operator DotNet Instrumentation image tag. | `0.7.0` | -| `opentelemetry-operator.instrumentation.dotnet.image` | OpenTelemetry Operator DotNet Instrumentation image. Deprecated, please use `repository` and `tag` instead. | `""` | -| `opentelemetry-operator.instrumentation.dotnet.metrics.enabled` | Flag to control metrics export from DotNet instrumentation in `Instrumentation` resource. | `true` | -| `opentelemetry-operator.instrumentation.dotnet.traces.enabled` | Flag to control traces export from DotNet instrumentation in `Instrumentation` resource. | `true` | -| `opentelemetry-operator.instrumentation.java.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | -| `opentelemetry-operator.instrumentation.java.repository` | OpenTelemetry Operator Java Instrumentation image repository. | `public.ecr.aws/sumologic/autoinstrumentation-java` | -| `opentelemetry-operator.instrumentation.java.tag` | OpenTelemetry Operator Java Instrumentation image tag. | `1.26.0` | -| `opentelemetry-operator.instrumentation.java.image` | OpenTelemetry Operator Java Instrumentation image. Deprecated, please use `repository` and `tag` instead. | `""` | -| `opentelemetry-operator.instrumentation.java.metrics.enabled` | Flag to control metrics export from Java instrumentation in `Instrumentation` resource. | `true` | -| `opentelemetry-operator.instrumentation.java.traces.enabled` | Flag to control traces export from Java instrumentation in `Instrumentation` resource. | `true` | -| `opentelemetry-operator.instrumentation.python.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | -| `opentelemetry-operator.instrumentation.python.repository` | OpenTelemetry Operator Python Instrumentation image repository. | `public.ecr.aws/sumologic/autoinstrumentation-python` | -| `opentelemetry-operator.instrumentation.python.tag` | OpenTelemetry Operator Python Instrumentation image tag. | `0.39b0` | -| `opentelemetry-operator.instrumentation.python.image` | OpenTelemetry Operator Python Instrumentation image. Deprecated, please use `repository` and `tag` instead. | `""` | -| `opentelemetry-operator.instrumentation.python.metrics.enabled` | Flag to control metrics export from Python instrumentation in `Instrumentation` resource. | `true` | -| `opentelemetry-operator.instrumentation.python.traces.enabled` | Flag to control traces export from Python instrumentation in `Instrumentation` resource. | `true` | -| `opentelemetry-operator.instrumentation.nodejs.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | -| `opentelemetry-operator.instrumentation.nodejs.repository` | OpenTelemetry Operator NodeJS Instrumentation image repository. | `public.ecr.aws/sumologic/autoinstrumentation-nodejs` | -| `opentelemetry-operator.instrumentation.nodejs.tag` | OpenTelemetry Operator NodeJS Instrumentation image tag. | `0.40.0` | -| `opentelemetry-operator.instrumentation.nodejs.image` | OpenTelemetry Operator NodeJS Instrumentation image. Deprecated, please use `repository` and `tag` instead. | `""` | +| `instrumentation.createDefaultInstrumentation` | Flag to control creation of default Instrumentation object | `false` | +| `instrumentation.dotnet.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | +| `opentelemetry-operator.manager.autoInstrumentationImage.dotnet.repository` | OpenTelemetry Operator DotNet Instrumentation iamfge repository. | `public.ecr.aws/sumologic/autoinstrumentation-dotnet` | +| `opentelemetry-operator.manager.autoInstrumentationImage.dotnet.tag` | OpenTelemetry Operator DotNet Instrumentation image tag. | `0.7.0` | +| `instrumentation.dotnet.metrics.enabled` | Flag to control metrics export from DotNet instrumentation in `Instrumentation` resource. | `true` | +| `instrumentation.dotnet.traces.enabled` | Flag to control traces export from DotNet instrumentation in `Instrumentation` resource. | `true` | +| `instrumentation.java.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | +| `opentelemetry-operator.manager.autoInstrumentationImage.java.repository` | OpenTelemetry Operator Java Instrumentation image repository. | `public.ecr.aws/sumologic/autoinstrumentation-java` | +| `opentelemetry-operator.manager.autoInstrumentationImage.java.tag` | OpenTelemetry Operator Java Instrumentation image tag. | `1.26.0` | +| `instrumentation.java.metrics.enabled` | Flag to control metrics export from Java instrumentation in `Instrumentation` resource. | `true` | +| `instrumentation.java.traces.enabled` | Flag to control traces export from Java instrumentation in `Instrumentation` resource. | `true` | +| `instrumentation.python.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | +| `opentelemetry-operator.manager.autoInstrumentationImage.python.repository` | OpenTelemetry Operator Python Instrumentation image repository. | `public.ecr.aws/sumologic/autoinstrumentation-python` | +| `opentelemetry-operator.manager.autoInstrumentationImage.python.tag` | OpenTelemetry Operator Python Instrumentation image tag. | `0.39b0` | +| `instrumentation.python.metrics.enabled` | Flag to control metrics export from Python instrumentation in `Instrumentation` resource. | `true` | +| `instrumentation.python.traces.enabled` | Flag to control traces export from Python instrumentation in `Instrumentation` resource. | `true` | +| `instrumentation.nodejs.metrics.enabled` | Flag to control metrics export from NodeJS instrumentation in `Instrumentation` resource. | `true` | +| `instrumentation.nodejs.extraEnvVars` | Additional environment variables for OpenTelemetry Operator Instrumentation Resource. | `{}` | +| `opentelemetry-operator.manager.autoInstrumentationImage.nodejs.repository` | OpenTelemetry Operator NodeJS Instrumentation image repository. | `public.ecr.aws/sumologic/autoinstrumentation-nodejs` | +| `opentelemetry-operator.manager.autoInstrumentationImage.nodejs.tag` | OpenTelemetry Operator NodeJS Instrumentation image tag. | `0.40.0` | | `opentelemetry-operator.manager.image.repository` | The default operator image repository for OpenTelemetry. | `public.ecr.aws/sumologic/opentelemetry-operator` | | `opentelemetry-operator.manager.collectorImage.repository` | The default collector image repository for OpenTelemetryCollector CRDs. | `public.ecr.aws/sumologic/sumologic-otel-collector` | | `opentelemetry-operator.manager.collectorImage.tag` | The default collector image tag for OpenTelemetryCollector CRDs. | `0.102.1-sumo-0` | @@ -325,9 +322,9 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `opentelemetry-operator.manager.resources.limits.memory` | Used to set limit Memory for OpenTelemetry-Operator Manager. | `512Mi` | | `opentelemetry-operator.manager.resources.requests.cpu` | Used to set requested CPU for OpenTelemetry-Operator Manager. | `150m` | | `opentelemetry-operator.manager.resources.requests.memory` | Used to set requested Memory for OpenTelemetry-Operator Manager. | `256Mi` | -| `opentelemetry-operator.instrumentationNamespaces` | Used to create `Instrumentation` resources in specified namespaces. | `Nil` | -| `opentelemetry-operator.instrumentationJobImage.image.repository` | Name of the image repository used to apply Instrumentation resource | `public.ecr.aws/sumologic/kubernetes-tools-kubectl` | -| `opentelemetry-operator.instrumentationJobImage.image.tag` | Name of the image tag used to apply Instrumentation resource | `2.22.0` | +| `instrumentation.instrumentationNamespaces` | Used to create `Instrumentation` resources in specified namespaces. | `Nil` | +| `instrumentation.instrumentationJobImage.image.repository` | Name of the image repository used to apply Instrumentation resource | `public.ecr.aws/sumologic/kubernetes-tools-kubectl` | +| `instrumentation.instrumentationJobImage.image.tag` | Name of the image tag used to apply Instrumentation resource | `2.22.0` | | `opentelemetry-operator.admissionWebhooks` | Admission webhooks make sure only requests with correctly formatted rules will get into the Operator. They also enable the sidecar injection for OpenTelemetryCollector and Instrumentation CR's. | See [values.yaml] | | `opentelemetry-operator.manager.env` | Additional environment variables for opentelemetry-operator helm chart. | `{"ENABLE_WEBHOOKS": "true"}` | | `opentelemetry-operator.kubeRBACProxy.image.repository` | Container repository for Kube RBAC Proxy. | `public.ecr.aws/sumologic/kube-rbac-proxy` | diff --git a/deploy/helm/sumologic/conf/opentelemetry-operator/instrumentation.cr.yaml b/deploy/helm/sumologic/conf/opentelemetry-operator/instrumentation.cr.yaml index 4d84ede9b0..50a73ac29c 100644 --- a/deploy/helm/sumologic/conf/opentelemetry-operator/instrumentation.cr.yaml +++ b/deploy/helm/sumologic/conf/opentelemetry-operator/instrumentation.cr.yaml @@ -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 @@ -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 -}} diff --git a/deploy/helm/sumologic/templates/opentelemetry-operator/configmap-instrumentation-cr.yaml b/deploy/helm/sumologic/templates/opentelemetry-operator/configmap-instrumentation-cr.yaml index 083aef1fe5..19e1ceda38 100644 --- a/deploy/helm/sumologic/templates/opentelemetry-operator/configmap-instrumentation-cr.yaml +++ b/deploy/helm/sumologic/templates/opentelemetry-operator/configmap-instrumentation-cr.yaml @@ -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 diff --git a/deploy/helm/sumologic/templates/opentelemetry-operator/job-instrumentation-cr.yaml b/deploy/helm/sumologic/templates/opentelemetry-operator/job-instrumentation-cr.yaml index 8019913295..ace7194fe1 100644 --- a/deploy/helm/sumologic/templates/opentelemetry-operator/job-instrumentation-cr.yaml +++ b/deploy/helm/sumologic/templates/opentelemetry-operator/job-instrumentation-cr.yaml @@ -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: diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index a2ddc68241..7c950ae9a0 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -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 @@ -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" @@ -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: diff --git a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.input.yaml b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.input.yaml index 88393f54e5..f06c4e68d8 100644 --- a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.input.yaml +++ b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.input.yaml @@ -1,33 +1,39 @@ opentelemetry-operator: enabled: true + manager: + autoInstrumentationImage: + dotnet: + repository: myrepo + tag: mytag + python: + repository: myrepo + tag: mytag + nodejs: + repository: myrepo + tag: mytag + java: + repository: myrepo + tag: mytag +instrumentation: createDefaultInstrumentation: true instrumentationNamespaces: "ot-operator1,ot-operator2" - instrumentation: - dotnet: - repository: myrepo - tag: mytag - image: dotnetimg - extraEnvVars: - - name: "test" - value: "dotnetval" - python: - repository: myrepo - tag: mytag - image: pythonimg - extraEnvVars: - - name: "test" - value: "pythonval" - nodejs: - repository: myrepo - tag: mytag - image: nodejsimg - extraEnvVars: - - name: "test" - value: "nodeval" - java: - repository: myrepo - tag: mytag - image: javaimg - extraEnvVars: - - name: "test" - value: "javaval" + instrumentationJobImage: + image: + repository: asd + tag: asd + dotnet: + extraEnvVars: + - name: "test" + value: "dotnetval" + python: + extraEnvVars: + - name: "test" + value: "pythonval" + nodejs: + extraEnvVars: + - name: "test" + value: "nodeval" + java: + extraEnvVars: + - name: "test" + value: "javaval" diff --git a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.output.yaml b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.output.yaml index 54d9f7338a..e479b89756 100644 --- a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.output.yaml +++ b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.additionalenvs.output.yaml @@ -35,7 +35,7 @@ data: - name: OTEL_RESOURCE_ATTRIBUTES value: application=ot-operator1 dotnet: - image: dotnetimg + image: myrepo:mytag env: - name: OTEL_METRICS_EXPORTER value: otlp @@ -50,7 +50,7 @@ data: - name: test value: dotnetval python: - image: pythonimg + image: myrepo:mytag env: - name: OTEL_METRICS_EXPORTER value: otlp @@ -63,14 +63,16 @@ data: - name: test value: pythonval nodejs: - image: nodejsimg + image: myrepo:mytag env: + - name: OTEL_METRICS_EXPORTER + value: otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://RELEASE-NAME-sumologic-otelagent.sumologic:4317 - name: test value: nodeval java: - image: javaimg + image: myrepo:mytag env: - name: OTEL_METRICS_EXPORTER value: otlp @@ -105,7 +107,7 @@ data: - name: OTEL_RESOURCE_ATTRIBUTES value: application=ot-operator2 dotnet: - image: dotnetimg + image: myrepo:mytag env: - name: OTEL_METRICS_EXPORTER value: otlp @@ -120,7 +122,7 @@ data: - name: test value: dotnetval python: - image: pythonimg + image: myrepo:mytag env: - name: OTEL_METRICS_EXPORTER value: otlp @@ -133,14 +135,16 @@ data: - name: test value: pythonval nodejs: - image: nodejsimg + image: myrepo:mytag env: + - name: OTEL_METRICS_EXPORTER + value: otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://RELEASE-NAME-sumologic-otelagent.sumologic:4317 - name: test value: nodeval java: - image: javaimg + image: myrepo:mytag env: - name: OTEL_METRICS_EXPORTER value: otlp diff --git a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.input.yaml b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.input.yaml index 31b2de9215..6ec89c0d1d 100644 --- a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.input.yaml +++ b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.input.yaml @@ -1,4 +1,9 @@ opentelemetry-operator: enabled: true +instrumentation: createDefaultInstrumentation: true instrumentationNamespaces: "ot-operator1,ot-operator2" + instrumentationJobImage: + image: + repository: asd + tag: asd diff --git a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.output.yaml b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.output.yaml index e8d26f30d9..30280c98b3 100644 --- a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.output.yaml +++ b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.output.yaml @@ -61,6 +61,8 @@ data: nodejs: image: public.ecr.aws/sumologic/autoinstrumentation-nodejs:0.40.0 env: + - name: OTEL_METRICS_EXPORTER + value: otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://RELEASE-NAME-sumologic-otelagent.sumologic:4317 java: @@ -123,6 +125,8 @@ data: nodejs: image: public.ecr.aws/sumologic/autoinstrumentation-nodejs:0.40.0 env: + - name: OTEL_METRICS_EXPORTER + value: otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://RELEASE-NAME-sumologic-otelagent.sumologic:4317 java: diff --git a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.input.yaml b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.input.yaml index 25983cc648..5055407dc6 100644 --- a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.input.yaml +++ b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.input.yaml @@ -1,17 +1,23 @@ opentelemetry-operator: enabled: true + manager: + autoInstrumentationImage: + dotnet: + repository: mydotnetrepo + tag: mydotnettag + python: + repository: mypythonrepo + tag: mypythontag + nodejs: + repository: mynodejsrepo + tag: mynodejstag + java: + repository: myjavarepo + tag: myjavatag +instrumentation: createDefaultInstrumentation: true instrumentationNamespaces: "ot-operator1,ot-operator2" - instrumentation: - dotnet: - repository: mydotnetrepo - tag: mydotnettag - python: - repository: mypythonrepo - tag: mypythontag - nodejs: - repository: mynodejsrepo - tag: mynodejstag - java: - repository: myjavarepo - tag: myjavatag + instrumentationJobImage: + image: + repository: asd + tag: asd diff --git a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.output.yaml b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.output.yaml index 07ab9a7847..49aa993a3e 100644 --- a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.output.yaml +++ b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_configmap/instrumentation.repository.output.yaml @@ -61,6 +61,8 @@ data: nodejs: image: mynodejsrepo:mynodejstag env: + - name: OTEL_METRICS_EXPORTER + value: otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://RELEASE-NAME-sumologic-otelagent.sumologic:4317 java: @@ -123,6 +125,8 @@ data: nodejs: image: mynodejsrepo:mynodejstag env: + - name: OTEL_METRICS_EXPORTER + value: otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://RELEASE-NAME-sumologic-otelagent.sumologic:4317 java: diff --git a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_job/job.input.yaml b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_job/job.input.yaml index c7c757cdce..8a7d1c1d46 100644 --- a/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_job/job.input.yaml +++ b/tests/helm/testdata/goldenfile/opentelemetry_operator_instrumentation_cr_job/job.input.yaml @@ -1,4 +1,5 @@ opentelemetry-operator: enabled: true +instrumentation: createDefaultInstrumentation: true instrumentationNamespaces: "ot-operator1" diff --git a/tests/integration/internal/stepfuncs/kubectl.go b/tests/integration/internal/stepfuncs/kubectl.go index 18901c5ea8..dcb095f1d8 100644 --- a/tests/integration/internal/stepfuncs/kubectl.go +++ b/tests/integration/internal/stepfuncs/kubectl.go @@ -61,15 +61,15 @@ func KubectlCreateOperatorNamespacesOpt() features.Func { return func(ctx context.Context, t *testing.T, envConf *envconf.Config) context.Context { valuesFileBytes := GetHelmValuesForT(t) var values struct { - Operator struct { + Instrumentation struct { InstrumentationNamespaces string `yaml:"instrumentationNamespaces"` - } `yaml:"opentelemetry-operator"` + } `yaml:"instrumentation"` } err := yaml.Unmarshal(valuesFileBytes, &values) require.NoError(t, err) - if values.Operator.InstrumentationNamespaces != "" { - namespaces := stdstrings.Split(values.Operator.InstrumentationNamespaces, ",") + if values.Instrumentation.InstrumentationNamespaces != "" { + namespaces := stdstrings.Split(values.Instrumentation.InstrumentationNamespaces, ",") for _, namespace := range namespaces { k8s.CreateNamespace(t, ctxopts.KubectlOptions(ctx, envConf), namespace) } @@ -83,15 +83,15 @@ func KubectlDeleteOperatorNamespacesOpt() features.Func { return func(ctx context.Context, t *testing.T, envConf *envconf.Config) context.Context { valuesFileBytes := GetHelmValuesForT(t) var values struct { - Operator struct { + Instrumentation struct { InstrumentationNamespaces string `yaml:"instrumentationNamespaces"` - } `yaml:"opentelemetry-operator"` + } `yaml:"instrumentation"` } err := yaml.Unmarshal(valuesFileBytes, &values) require.NoError(t, err) - if values.Operator.InstrumentationNamespaces != "" { - namespaces := stdstrings.Split(values.Operator.InstrumentationNamespaces, ",") + if values.Instrumentation.InstrumentationNamespaces != "" { + namespaces := stdstrings.Split(values.Instrumentation.InstrumentationNamespaces, ",") for _, namespace := range namespaces { ctx = KubectlDeleteNamespaceOpt(namespace, true)(ctx, t, envConf) } diff --git a/tests/integration/values/values_helm_opentelemetry_operator_enabled.yaml b/tests/integration/values/values_helm_opentelemetry_operator_enabled.yaml index 5c2b6807d1..7e77c33482 100644 --- a/tests/integration/values/values_helm_opentelemetry_operator_enabled.yaml +++ b/tests/integration/values/values_helm_opentelemetry_operator_enabled.yaml @@ -9,8 +9,7 @@ sumologic: opentelemetry-operator: enabled: true - createDefaultInstrumentation: true - instrumentationNamespaces: "ot-operator-enabled-1,ot-operator-enabled-2" + manager: resources: requests: @@ -23,5 +22,9 @@ opentelemetry-operator: cpu: 5m memory: 64Mi +instrumentation: + createDefaultInstrumentation: true + instrumentationNamespaces: "ot-operator-enabled-1,ot-operator-enabled-2" + otelcolInstrumentation: enabled: true diff --git a/tests/integration/values/values_opentelemetry_operator_instrumentation.yaml b/tests/integration/values/values_opentelemetry_operator_instrumentation.yaml index e2e8cdff0a..2fa1ede804 100644 --- a/tests/integration/values/values_opentelemetry_operator_instrumentation.yaml +++ b/tests/integration/values/values_opentelemetry_operator_instrumentation.yaml @@ -9,8 +9,7 @@ sumologic: opentelemetry-operator: enabled: true - createDefaultInstrumentation: true - instrumentationNamespaces: "ot-operator-instr-1,ot-operator-instr-2,test-apps" + manager: resources: requests: @@ -23,6 +22,10 @@ opentelemetry-operator: cpu: 5m memory: 64Mi +instrumentation: + createDefaultInstrumentation: true + instrumentationNamespaces: "ot-operator-instr-1,ot-operator-instr-2,test-apps" + otelcolInstrumentation: enabled: true