diff --git a/.chloggen/3090-enable-multiinstrumentation-by-default.yaml b/.chloggen/3090-enable-multiinstrumentation-by-default.yaml new file mode 100755 index 0000000000..29cbebcef3 --- /dev/null +++ b/.chloggen/3090-enable-multiinstrumentation-by-default.yaml @@ -0,0 +1,30 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'breaking' + +# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action) +component: auto-instrumentation + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Enable multi instrumentation by default. + +# One or more tracking issues related to the change +issues: [3090] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + Starting with this release, the OpenTelemetry Operator now enables multi-instrumentation by default. + This enhancement allows instrumentation of multiple containers in a pod with language-specific configurations.| + Key Changes: + - Single Instrumentation (Default Behavior): If no container names are specified using the + `instrumentation.opentelemetry.io/container-names` annotation, instrumentation will be applied to the first container in + the pod spec by default. This only applies when single instrumentation injection is configured. + - Multi-Container Pods: In scenarios where different containers in a pod use distinct technologies, users must specify the + container(s) for instrumentation using language-specific annotations. Without this specification, the default behavior may + not work as expected for multi-container environments. + Compatibility: + - Users already utilizing the `instrumentation.opentelemetry.io/container-names` annotation do not need to take any action. + Their existing setup will continue to function as before. + - Important: Users who attempt to configure both `instrumentation.opentelemetry.io/container-names` and language-specific annotations + (for multi-instrumentation) simultaneously will encounter an error, as this configuration is not supported. diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index b31ffa604a..be5d396855 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -38,7 +38,7 @@ jobs: - group: e2e-instrumentation setup: "add-instrumentation-params prepare-e2e" - group: e2e-multi-instrumentation - setup: "add-multi-instrumentation-params prepare-e2e" + setup: "add-instrumentation-params prepare-e2e" - group: e2e-metadata-filters setup: "add-operator-arg OPERATOR_ARG='--annotations-filter=.*filter.out --annotations-filter=config.*.gke.io.* --labels-filter=.*filter.out' prepare-e2e" - group: e2e-automatic-rbac diff --git a/main.go b/main.go index a348db6496..55c754f2fb 100644 --- a/main.go +++ b/main.go @@ -151,7 +151,7 @@ func main() { "Enabling this will ensure there is only one active controller manager.") pflag.BoolVar(&createRBACPermissions, "create-rbac-permissions", false, "Automatically create RBAC permissions needed by the processors (deprecated)") pflag.BoolVar(&createOpenShiftDashboard, "openshift-create-dashboard", false, "Create an OpenShift dashboard for monitoring the OpenTelemetryCollector instances") - pflag.BoolVar(&enableMultiInstrumentation, "enable-multi-instrumentation", false, "Controls whether the operator supports multi instrumentation") + pflag.BoolVar(&enableMultiInstrumentation, "enable-multi-instrumentation", true, "Controls whether the operator supports multi instrumentation") pflag.BoolVar(&enableApacheHttpdInstrumentation, constants.FlagApacheHttpd, true, "Controls whether the operator supports Apache HTTPD auto-instrumentation") pflag.BoolVar(&enableDotNetInstrumentation, constants.FlagDotNet, true, "Controls whether the operator supports dotnet auto-instrumentation") pflag.BoolVar(&enableGoInstrumentation, constants.FlagGo, false, "Controls whether the operator supports Go auto-instrumentation") diff --git a/tests/e2e-instrumentation/instrumentation-apache-multicontainer/01-assert.yaml b/tests/e2e-instrumentation/instrumentation-apache-multicontainer/01-assert.yaml index 1e1c7f0fc4..952f1f4d0c 100644 --- a/tests/e2e-instrumentation/instrumentation-apache-multicontainer/01-assert.yaml +++ b/tests/e2e-instrumentation/instrumentation-apache-multicontainer/01-assert.yaml @@ -13,10 +13,12 @@ spec: - name: OTEL_NODE_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.hostIP - name: OTEL_POD_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.podIP - name: OTEL_SERVICE_NAME value: my-apache-multi @@ -44,10 +46,12 @@ spec: - name: OTEL_NODE_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.hostIP - name: OTEL_POD_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.podIP - name: OTEL_SERVICE_NAME value: my-apache-multi diff --git a/tests/e2e-instrumentation/instrumentation-apache-multicontainer/02-assert.yaml b/tests/e2e-instrumentation/instrumentation-apache-multicontainer/02-assert.yaml index 686504f65d..231ca34b7c 100644 --- a/tests/e2e-instrumentation/instrumentation-apache-multicontainer/02-assert.yaml +++ b/tests/e2e-instrumentation/instrumentation-apache-multicontainer/02-assert.yaml @@ -24,10 +24,12 @@ spec: - name: OTEL_NODE_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.hostIP - name: OTEL_POD_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.podIP - name: OTEL_SERVICE_NAME value: my-apache-multi diff --git a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-assert.yaml b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-assert.yaml index 05b5ea6864..47b10a1a45 100644 --- a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-assert.yaml +++ b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-assert.yaml @@ -13,10 +13,12 @@ spec: - name: OTEL_NODE_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.hostIP - name: OTEL_POD_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.podIP - name: LD_LIBRARY_PATH value: /opt:/opt/opentelemetry-webserver/agent/sdk_lib/lib @@ -53,10 +55,12 @@ spec: - name: OTEL_NODE_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.hostIP - name: OTEL_POD_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.podIP - name: OTEL_SERVICE_NAME value: my-nginx-multi diff --git a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-install-app.yaml b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-install-app.yaml index 16702d30b2..523a44efcf 100644 --- a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-install-app.yaml +++ b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/01-install-app.yaml @@ -45,7 +45,6 @@ spec: mountPath: /etc/nginx/nginx.conf subPath: nginx.conf readOnly: true - imagePullPolicy: Always resources: limits: cpu: 500m diff --git a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/02-assert.yaml b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/02-assert.yaml index 620fc7d27b..b16e4a4a8a 100644 --- a/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/02-assert.yaml +++ b/tests/e2e-instrumentation/instrumentation-nginx-multicontainer/02-assert.yaml @@ -24,10 +24,12 @@ spec: - name: OTEL_NODE_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.hostIP - name: OTEL_POD_IP valueFrom: fieldRef: + apiVersion: v1 fieldPath: status.podIP - name: LD_LIBRARY_PATH value: /opt:/opt/opentelemetry-webserver/agent/sdk_lib/lib