Add error breadcrumbs/event context support to APM error events
- Dominant language
- Gherkin
- Stars
- 427
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
APM error details currently help users inspect error groups, occurrences, stack traces, and event metadata, but they do not provide a standard way to see the sequence of contextual events that led up to an error.
In tools such as Sentry, breadcrumbs such as user interactions, navigation events, console/log messages, and selected runtime events make it easier to reconstruct what happened before an error. In Elastic APM, users can add custom context manually, and related traces/logs may exist elsewhere, but there is no shared APM agent specification for attaching bounded breadcrumb/event context to error events.
This gap makes the debugging workflow less direct when the stack trace alone is insufficient.
Related prior request: elastic/apm-agent-rum-js#407 requested Sentry-like breadcrumbs for the RUM agent.
**Describe the solution you'd like**
Define APM error breadcrumb/event context support in the agent specifications so agents can collect and send a bounded list of recent contextual events with an error.
The spec should cover:
- Breadcrumb schema, for example timestamp, category/type, message, level, and optional structured data.
- Attachment model: whether breadcrumbs are embedded on the error event, linked by session/trace, or represented as related events.
- Collection scope by agent family, especially RUM, mobile, and server-side agents.
- Limits: maximum breadcrumb count, size per breadcrumb, total payload size, and truncation behavior.
- Sanitization and privacy requirements, including secrets, PII, URLs, headers, and user-provided values.
- Whether manually added breadcrumbs should be supported by public agent APIs.
- How Kibana should display breadcrumbs in APM error group details.
**Describe alternatives you've considered**
- Relying only on custom context or labels. This is flexible, but it requires each application team to design its own convention and does not provide a consistent UI experience.
- Linking users to logs or traces only. This is useful when logs/traces are available and correlated, but it does not replace a concise event timeline attached to the error.
- Implementing this only in Kibana. Kibana can improve presentation, but it cannot show breadcrumbs consistently unless agents and intake define a common data model.
**Additional context**
Kibana already has APM error group detail pages that show occurrence charts, error samples, stack traces, metadata, related transactions, and Discover links. The missing piece is a first-class breadcrumb/event-context timeline comparable to Sentry's error issue detail workflow.
This would likely need coordination between the APM spec, one or more agents, APM Server/intake mapping, and Kibana APM UI.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.