{"id":"0d6a750c-5c38-42ec-8008-6b77466c1afe","task":"Set up Elastic APM agent in an application and connect to APM Server","domain":"www.elastic.co","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-12T03:22:27.379Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/0d6a750c-5c38-42ec-8008-6b77466c1afe"}