From d970c6625ab8d17d5216aa4a91184aaa438a87c8 Mon Sep 17 00:00:00 2001 From: Julia Bardi <90178898+juliaElastic@users.noreply.github.com> Date: Fri, 3 May 2024 14:28:17 +0200 Subject: [PATCH] [Fleet] added doc how to enable apm on fleet managed agent (#182550) Related to https://github.com/elastic/fleet-server/issues/3516 Documented how to enable apm tracing on fleet managed agents. --- x-pack/plugins/fleet/dev_docs/apm_tracing.md | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 x-pack/plugins/fleet/dev_docs/apm_tracing.md diff --git a/x-pack/plugins/fleet/dev_docs/apm_tracing.md b/x-pack/plugins/fleet/dev_docs/apm_tracing.md new file mode 100644 index 0000000000000..cf57794b11ca8 --- /dev/null +++ b/x-pack/plugins/fleet/dev_docs/apm_tracing.md @@ -0,0 +1,26 @@ +# Enable APM tracing on Fleet managed agent + +1. Enroll agent with default config +2. Agent config will be overwritten by the Fleet Agent policy +3. Add APM config to the installed agent config file e.g. on Mac /Library/Elastic/Agent/elastic-agent.yml +``` +agent.monitoring: + traces: true + apm: + hosts: + - + environment: + secret_token: +``` +4. Restart agent to pick up the changes (on standalone agent there is hot reload): https://www.elastic.co/guide/en/fleet/current/start-stop-elastic-agent.html +5. APM config should be applied, and traces should be sent to the APM server configured +6. Observe "APM instrumentation enabled" in the agent logs + +More info in agent doc: https://github.com/elastic/elastic-agent/blob/main/docs/tracing.md + +## Cloud configuration + +- ECS uses the same methodology to add APM config on production builds (e.g. BC). +- Cloud logic that adds APM config: https://github.com/elastic/cloud/blob/master/scala-services/runner/src/main/scala/no/found/runner/allocation/stateless/ApmDockerContainer.scala#L434 +- APM is not enabled by default on deployments with SNAPSHOT builds, see all conditions here: https://github.com/elastic/cloud/pull/124414 +