Skip to content

Commit 26c5c56

Browse files
authored
fix: close default apm tracer (elastic#17293)
the default tracer is leaking and its background goroutine spamming requests to this apm server (default endpoint) If TLS is enabled it causes 'http request sent to https endpoint'. Close the default tracer since it's not used.
1 parent 2e8498c commit 26c5c56

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/beater/beater.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ type RunnerParams struct {
124124
func NewRunner(args RunnerParams) (*Runner, error) {
125125
fips140.CheckFips()
126126

127+
// the default tracer is leaking and its background
128+
// goroutine is spamming requests to this apm server (default endpoint)
129+
// If TLS is enabled it causes "http request sent to https endpoint".
130+
// Close the default tracer since it's not used.
131+
apm.DefaultTracer().Close()
132+
127133
var unpackedConfig struct {
128134
APMServer *agentconfig.C `config:"apm-server"`
129135
Output agentconfig.Namespace `config:"output"`

0 commit comments

Comments
 (0)