Skip to content

Commit

Permalink
Enable multi instrumentation by default (#3302)
Browse files Browse the repository at this point in the history
* Enable multi instrumentation by default

Signed-off-by: Israel Blancas <[email protected]>

* Run all instrumenation tests with multi-instrumentation flag added

* Remove enable multiinstrumentation in e2e tests since it will be enabled by default

Signed-off-by: Israel Blancas <[email protected]>

* Improve release notes

Signed-off-by: Israel Blancas <[email protected]>

* Remove duplicated fields

Signed-off-by: Israel Blancas <[email protected]>

---------

Signed-off-by: Israel Blancas <[email protected]>
Co-authored-by: Ishwar Kanse <[email protected]>
  • Loading branch information
iblancasa and IshwarKanse authored Oct 1, 2024
1 parent 94249dc commit 218ff4a
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .chloggen/3090-enable-multiinstrumentation-by-default.yaml
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ spec:
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
imagePullPolicy: Always
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 218ff4a

Please sign in to comment.