Skip to content

Commit

Permalink
[Fleet] added doc how to enable apm on fleet managed agent (elastic#1…
Browse files Browse the repository at this point in the history
…82550)

Related to elastic/fleet-server#3516

Documented how to enable apm tracing on fleet managed agents.
  • Loading branch information
juliaElastic authored May 3, 2024
1 parent 9f0deb3 commit d970c66
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions x-pack/plugins/fleet/dev_docs/apm_tracing.md
Original file line number Diff line number Diff line change
@@ -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:
- <apm host url>
environment: <apm environment>
secret_token: <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

0 comments on commit d970c66

Please sign in to comment.