Install the Elastic APM agent library for your language (e.g. 'pip install elastic-apm' for Python, '@elastic/apm-node' for Node.js)
Configure the agent with the APM Server URL and a secret token or API key: set ELASTIC_APM_SERVER_URL, ELASTIC_APM_SECRET_TOKEN (or ELASTIC_APM_API_KEY), and ELASTIC_APM_SERVICE_NAME as environment variables or in the agent config
Initialize the agent at application startup before other imports (for Node.js require it as the first line; for Python call elasticapm.instrument() early in the process)
Deploy APM Server configured to accept data from the agent URL and forward to Elasticsearch; set 'output.elasticsearch.hosts' and 'apm-server.auth.secret_token' in apm-server.yml
Verify traces appear in Kibana under Observability > APM > Services; check APM Server logs for auth errors or connectivity issues if the service does not appear
Known gotchas
The secret token must match exactly between the agent and APM Server; a mismatch causes 401 rejections that the agent may silently swallow or log at debug level only
Auto-instrumentation patches framework internals at startup; loading the APM agent after the web framework (Express, Flask, etc.) is already initialized will result in missing transaction capture
APM Server has a default payload size limit; large traces with many spans may be truncated — tune 'max_event_bytes' in APM Server config if spans are being dropped
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp