From 71e88b9dfde47eb67a062a93a0cff93f503ffaf6 Mon Sep 17 00:00:00 2001 From: Kostiantyn Masliuk <1pkg@protonmail.com> Date: Mon, 29 Jul 2024 18:36:44 -0700 Subject: [PATCH 1/2] fix: temporary disable apm tracer config --- internal/beatcmd/beat_test.go | 2 +- internal/beatcmd/reloader.go | 5 +++-- internal/beatcmd/reloader_test.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/beatcmd/beat_test.go b/internal/beatcmd/beat_test.go index 4f71188a9d8..2599647fc21 100644 --- a/internal/beatcmd/beat_test.go +++ b/internal/beatcmd/beat_test.go @@ -183,7 +183,7 @@ func TestRunManager(t *testing.T) { }, }, "instrumentation": map[string]interface{}{ - "enabled": true, + "enabled": false, "environment": "testenv", }, }, m) diff --git a/internal/beatcmd/reloader.go b/internal/beatcmd/reloader.go index fe72f860892..297fa328cc9 100644 --- a/internal/beatcmd/reloader.go +++ b/internal/beatcmd/reloader.go @@ -194,8 +194,9 @@ func (r *Reloader) reload(inputConfig, outputConfig, apmTracingConfig *config.C) if err != nil { return fmt.Errorf("APM tracing config for elastic not found") } - // set enabled manually as APMConfig doesn't contain it - c.SetBool("enabled", -1, true) + // set enabled manually as APMConfig doesn't contain it. + // TODO set "enable" to true after the issue https://github.com/elastic/elastic-agent/issues/5211 gets resolved. + c.SetBool("enabled", -1, false) wrappedApmTracingConfig = config.MustNewConfigFrom(map[string]interface{}{ "instrumentation": c, }) diff --git a/internal/beatcmd/reloader_test.go b/internal/beatcmd/reloader_test.go index 0dbd88195f3..83a7fb38b6e 100644 --- a/internal/beatcmd/reloader_test.go +++ b/internal/beatcmd/reloader_test.go @@ -186,7 +186,7 @@ func TestReloaderNewRunnerParams(t *testing.T) { args := <-calls assert.NotNil(t, args.Logger) assert.Equal(t, info, args.Info) - assert.Equal(t, config.MustNewConfigFrom(`{"revision": 1, "input": 123, "output.console.enabled": true, "instrumentation.enabled":true, "instrumentation.environment":"test"}`), args.Config) + assert.Equal(t, config.MustNewConfigFrom(`{"revision": 1, "input": 123, "output.console.enabled": true, "instrumentation.enabled":false, "instrumentation.environment":"test"}`), args.Config) } func expectNoEvent(t testing.TB, ch <-chan struct{}, message string) { From b5daadb2b5751359e4270f29d6879722a71b2797 Mon Sep 17 00:00:00 2001 From: Kostiantyn Masliuk <1pkg@protonmail.com> Date: Mon, 29 Jul 2024 18:42:53 -0700 Subject: [PATCH 2/2] update changelog with disabled self-instrumentation PR --- changelogs/8.15.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/8.15.asciidoc b/changelogs/8.15.asciidoc index 9abaa71e41f..74af3d52788 100644 --- a/changelogs/8.15.asciidoc +++ b/changelogs/8.15.asciidoc @@ -33,5 +33,5 @@ https://github.com/elastic/apm-server/compare/v8.14.3\...v8.15.0[View commits] - Upgraded bundled APM Java agent attacher CLI to version 1.50.0 {pull}13326[13326] - Enable Kibana curated UIs to work with hostmetrics from OpenTelemetry's https://pkg.go.dev/go.opentelemetry.io/collector/receiver/hostmetricsreceiver[hostmetricsreceiver] {pull}13196[13196] - Add require data stream to bulk index requests {pull}13398[13398] -- Support self-instrumentation when in managed mode by getting tracing configs via reloader {pull}13514[13514] {pull}13653[13653] {pull}13691[13691] +- Support self-instrumentation when in managed mode by getting tracing configs via reloader {pull}13514[13514] {pull}13653[13653] {pull}13691[13691] {pull}13790[13790] - Add mapping for OpenTelemetry attribute `messaging.destination.name` to derive `service.target` correctly {pull}13472[13472]