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() 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 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 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