From ff4ffa6b6a92d3220805b9f0ed3218a139aed30c Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 16 Nov 2023 14:32:52 -0700 Subject: [PATCH] [autoinstrumentation] Bump go auto instrumentation to 0.8.0-alpha (#2358) * Bump go auto instrumentation to 0.8.0-alpha * Changelog * Update readme --- .chloggen/bump-go-instrumentation-version.yaml | 16 ++++++++++++++++ README.md | 10 +++++++--- pkg/instrumentation/golang.go | 3 --- pkg/instrumentation/golang_test.go | 9 --------- pkg/instrumentation/podmutator_test.go | 3 --- pkg/instrumentation/sdk_test.go | 6 ------ .../instrumentation-go/02-assert.yaml | 2 +- .../instrumentation-go/scc.yaml | 2 -- versions.txt | 2 +- 9 files changed, 25 insertions(+), 28 deletions(-) create mode 100755 .chloggen/bump-go-instrumentation-version.yaml diff --git a/.chloggen/bump-go-instrumentation-version.yaml b/.chloggen/bump-go-instrumentation-version.yaml new file mode 100755 index 0000000000..b6c15a5722 --- /dev/null +++ b/.chloggen/bump-go-instrumentation-version.yaml @@ -0,0 +1,16 @@ +# 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. operator, target allocator, github action) +component: autoinstrumentation + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Bump Go auto instrumentation version to v0.8.0-alpha + +# One or more tracking issues related to the change +issues: [2358] + +# (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: The default export protocol was switched from `grpc` to `http/proto` diff --git a/README.md b/README.md index cc7bc896bd..75d7546629 100644 --- a/README.md +++ b/README.md @@ -223,6 +223,13 @@ spec: # See https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/888e2cd216c77d12e56b54ee91dafbc4e7452a52/docs/config.md#otlp - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://otel-collector:4318 + go: + env: + # Required if endpoint is set to 4317. + # Go autoinstrumentation uses http/proto by default + # so data must be sent to 4318 instead of 4317. + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: http://otel-collector:4318 EOF ``` @@ -279,9 +286,6 @@ Go auto-instrumentation also requires elevated permissions. The below permission ```yaml securityContext: - capabilities: - add: - - SYS_PTRACE privileged: true runAsUser: 0 ``` diff --git a/pkg/instrumentation/golang.go b/pkg/instrumentation/golang.go index ef78e1b6a7..2ae2e62379 100644 --- a/pkg/instrumentation/golang.go +++ b/pkg/instrumentation/golang.go @@ -61,9 +61,6 @@ func injectGoSDK(goSpec v1alpha1.Go, pod corev1.Pod) (corev1.Pod, error) { SecurityContext: &corev1.SecurityContext{ RunAsUser: &zero, Privileged: &true, - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_PTRACE"}, - }, }, VolumeMounts: []corev1.VolumeMount{ { diff --git a/pkg/instrumentation/golang_test.go b/pkg/instrumentation/golang_test.go index ba3ed7ca9f..9cade61da9 100644 --- a/pkg/instrumentation/golang_test.go +++ b/pkg/instrumentation/golang_test.go @@ -136,9 +136,6 @@ func TestInjectGoSDK(t *testing.T) { SecurityContext: &corev1.SecurityContext{ RunAsUser: &zero, Privileged: &true, - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_PTRACE"}, - }, }, VolumeMounts: []corev1.VolumeMount{ { @@ -200,9 +197,6 @@ func TestInjectGoSDK(t *testing.T) { SecurityContext: &corev1.SecurityContext{ RunAsUser: &zero, Privileged: &true, - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_PTRACE"}, - }, }, VolumeMounts: []corev1.VolumeMount{ { @@ -257,9 +251,6 @@ func TestInjectGoSDK(t *testing.T) { SecurityContext: &corev1.SecurityContext{ RunAsUser: &zero, Privileged: &true, - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_PTRACE"}, - }, }, VolumeMounts: []corev1.VolumeMount{ { diff --git a/pkg/instrumentation/podmutator_test.go b/pkg/instrumentation/podmutator_test.go index 54f8a762b4..b2b39d45f1 100644 --- a/pkg/instrumentation/podmutator_test.go +++ b/pkg/instrumentation/podmutator_test.go @@ -2434,9 +2434,6 @@ func TestMutatePod(t *testing.T) { SecurityContext: &corev1.SecurityContext{ RunAsUser: &zero, Privileged: &true, - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_PTRACE"}, - }, }, VolumeMounts: []corev1.VolumeMount{ { diff --git a/pkg/instrumentation/sdk_test.go b/pkg/instrumentation/sdk_test.go index b5817e28d6..013a5ffc37 100644 --- a/pkg/instrumentation/sdk_test.go +++ b/pkg/instrumentation/sdk_test.go @@ -1058,9 +1058,6 @@ func TestInjectGo(t *testing.T) { SecurityContext: &corev1.SecurityContext{ RunAsUser: &zero, Privileged: &true, - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_PTRACE"}, - }, }, VolumeMounts: []corev1.VolumeMount{ { @@ -1162,9 +1159,6 @@ func TestInjectGo(t *testing.T) { SecurityContext: &corev1.SecurityContext{ RunAsUser: &zero, Privileged: &true, - Capabilities: &corev1.Capabilities{ - Add: []corev1.Capability{"SYS_PTRACE"}, - }, }, VolumeMounts: []corev1.VolumeMount{ { diff --git a/tests/e2e-instrumentation/instrumentation-go/02-assert.yaml b/tests/e2e-instrumentation/instrumentation-go/02-assert.yaml index c7b1fdeb9c..1d0787dc34 100644 --- a/tests/e2e-instrumentation/instrumentation-go/02-assert.yaml +++ b/tests/e2e-instrumentation/instrumentation-go/02-assert.yaml @@ -19,7 +19,7 @@ spec: requests: cpu: "50m" memory: "32Mi" - image: ghcr.io/open-telemetry/opentelemetry-go-instrumentation/autoinstrumentation-go:v0.7.0-alpha + image: ghcr.io/open-telemetry/opentelemetry-go-instrumentation/autoinstrumentation-go:v0.8.0-alpha env: - name: OTEL_GO_AUTO_TARGET_EXE value: /usr/src/app/productcatalogservice diff --git a/tests/e2e-instrumentation/instrumentation-go/scc.yaml b/tests/e2e-instrumentation/instrumentation-go/scc.yaml index 45891eb6d3..b32985664a 100644 --- a/tests/e2e-instrumentation/instrumentation-go/scc.yaml +++ b/tests/e2e-instrumentation/instrumentation-go/scc.yaml @@ -5,8 +5,6 @@ metadata: allowHostDirVolumePlugin: true allowPrivilegeEscalation: true allowPrivilegedContainer: true -allowedCapabilities: -- 'SYS_PTRACE' fsGroup: type: RunAsAny runAsUser: diff --git a/versions.txt b/versions.txt index 65965cec13..8e9172583a 100644 --- a/versions.txt +++ b/versions.txt @@ -30,7 +30,7 @@ autoinstrumentation-python=0.41b0 autoinstrumentation-dotnet=1.1.0 # Represents the current release of Go instrumentation. -autoinstrumentation-go=v0.7.0-alpha +autoinstrumentation-go=v0.8.0-alpha # Represents the current release of Apache HTTPD instrumentation. # Should match autoinstrumentation/apache-httpd/version.txt