From c6169bc689d9b4820c9db0c131057573f360f69d Mon Sep 17 00:00:00 2001 From: Dylan Myers Date: Thu, 13 Mar 2025 12:08:01 -0400 Subject: [PATCH 1/4] temporary workaround for aix --- cmd/opampsupervisor/supervisor/templates/nooppipeline.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/opampsupervisor/supervisor/templates/nooppipeline.yaml b/cmd/opampsupervisor/supervisor/templates/nooppipeline.yaml index 67bfdd611482c..c3a6dba07c61b 100644 --- a/cmd/opampsupervisor/supervisor/templates/nooppipeline.yaml +++ b/cmd/opampsupervisor/supervisor/templates/nooppipeline.yaml @@ -8,3 +8,9 @@ service: traces: receivers: [nop] exporters: [nop] + + telemetry: + # Disable agents own telemetry to avoid port binding collisions for port 8888. Bindplane + # will enable metrics and configure the port when a configuration is pushed to the agent. + metrics: + level: none From 71b89430b5ff840e929e11c5763f6ad0e81e2aaa Mon Sep 17 00:00:00 2001 From: Dylan Myers Date: Thu, 13 Mar 2025 15:14:49 -0400 Subject: [PATCH 2/4] add telemetry disable to opampextension too --- .../supervisor/templates/opampextension.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/opampsupervisor/supervisor/templates/opampextension.yaml b/cmd/opampsupervisor/supervisor/templates/opampextension.yaml index ecc8bf9f4261e..064945fac57af 100644 --- a/cmd/opampsupervisor/supervisor/templates/opampextension.yaml +++ b/cmd/opampsupervisor/supervisor/templates/opampextension.yaml @@ -13,3 +13,9 @@ extensions: service: extensions: [opamp] + + telemetry: + # Disable agents own telemetry to avoid port binding collisions for port 8888. Bindplane + # will enable metrics and configure the port when a configuration is pushed to the agent. + metrics: + level: none From 0e7df5cf3b96cb7b35211cd1562ac351d340790e Mon Sep 17 00:00:00 2001 From: Dylan Myers Date: Mon, 9 Jun 2025 12:22:51 -0400 Subject: [PATCH 3/4] Edit supervisor stop command for AIX --- .../supervisor/commander/commander_aix.go | 20 +++++++++++++++++++ .../supervisor/commander/commander_others.go | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 cmd/opampsupervisor/supervisor/commander/commander_aix.go diff --git a/cmd/opampsupervisor/supervisor/commander/commander_aix.go b/cmd/opampsupervisor/supervisor/commander/commander_aix.go new file mode 100644 index 0000000000000..e04dbf24d4bf2 --- /dev/null +++ b/cmd/opampsupervisor/supervisor/commander/commander_aix.go @@ -0,0 +1,20 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:build aix + +package commander + +import ( + "os" + "syscall" +) + +func sendShutdownSignal(process *os.Process) error { + return process.Signal(syscall.SIGTERM) +} + +func sysProcAttrs() *syscall.SysProcAttr { + // On non-windows systems, no extra attributes are needed. + return nil +} diff --git a/cmd/opampsupervisor/supervisor/commander/commander_others.go b/cmd/opampsupervisor/supervisor/commander/commander_others.go index 15fe0f7e97c4e..1b1ae154172e6 100644 --- a/cmd/opampsupervisor/supervisor/commander/commander_others.go +++ b/cmd/opampsupervisor/supervisor/commander/commander_others.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -//go:build !windows +//go:build !windows && !aix package commander From 1f7d4f331ac901f3be2e5a81531e5e3757f02e71 Mon Sep 17 00:00:00 2001 From: Dylan Myers Date: Thu, 19 Jun 2025 12:18:45 -0400 Subject: [PATCH 4/4] listen for SIGTERM in addition to SIGINT when shutting down the supervisor --- cmd/opampsupervisor/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/opampsupervisor/main.go b/cmd/opampsupervisor/main.go index 17a62e2033cd9..90d9d01cfef3b 100644 --- a/cmd/opampsupervisor/main.go +++ b/cmd/opampsupervisor/main.go @@ -9,6 +9,7 @@ import ( "log" "os" "os/signal" + "syscall" "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor/supervisor" "github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor/supervisor/config" @@ -46,7 +47,7 @@ func runInteractive() error { } interrupt := make(chan os.Signal, 1) - signal.Notify(interrupt, os.Interrupt) + signal.Notify(interrupt, os.Interrupt, syscall.SIGTERM) <-interrupt supervisor.Shutdown()