Skip to content

feat(transactions): Preserve contexts, extra, and breadcrumbs - #6286

Merged
mjq merged 4 commits into
masterfrom
mjq/store-transaction-non-attributes
Aug 6, 2026
Merged

feat(transactions): Preserve contexts, extra, and breadcrumbs#6286
mjq merged 4 commits into
masterfrom
mjq/store-transaction-non-attributes

Conversation

@mjq

@mjq mjq commented Aug 4, 2026

Copy link
Copy Markdown
Member

The frontend is currently still relying on full transaction JSON from Nodestore to fetch transaction events' contexts, extras, and breadcrumbs in the span details pane of the trace waterfall.

A few important, defined keys in contexts are already extracted into attributes by Relay, but that does not cover custom keys or custom contexts, which are currently dropped. Extras (all custom) and breadcrumbs have no handling at all and are also dropped.

All of these features are deprecated: contexts and events have been replaced with attributes, and breadcrumbs have been replaced by logs. There is no need to make these legacy data sources searchable or have the same level of support as their replacements. Nonetheless, if a user of a transaction-based SDK sends this data, we don't want to just drop it.

Serialize contexts, extras, and breadcrumbs into JSON and store them as attributes. These attributes will be marked internal in Conventions so that they aren't displayed to users. Their only use will be on the span details pane of the trace waterfall, where they will be deserialized and shown the same way they currently are for was_transaction: true spans.

Note: I skipped serializing the trace context, since this is already fully extracted to make the transaction span and therefore useless duplication.

Note 2: This PR updates sentry-conventions to get the new constants.

Fixes BROWSE-670.


I'll add the attribute names to conventions after we've confirmed the approach and names here on this draft, before merging.

@linear-code

linear-code Bot commented Aug 4, 2026

Copy link
Copy Markdown

BROWSE-670

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 44c2e63. Configure here.

Comment thread relay-conventions/src/lib.rs Outdated
@mjq

mjq commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Conventions PR: getsentry/sentry-conventions#556

@mjq
mjq marked this pull request as ready for review August 5, 2026 21:12
@mjq
mjq requested a review from a team as a code owner August 5, 2026 21:12
@mjq
mjq added this pull request to the merge queue Aug 6, 2026
Merged via the queue into master with commit 6fab393 Aug 6, 2026
35 checks passed
@mjq
mjq deleted the mjq/store-transaction-non-attributes branch August 6, 2026 11:26
mjq added a commit to getsentry/sentry that referenced this pull request Aug 7, 2026
Adds an `event` field to the trace item details endpoint response,
containing `contexts`, `extra`, and `breadcrumbs` properties. These are
taken from the incoming transaction event and stored as attributes by
Relay. (getsentry/relay#6286).

The span details pane in the trace waterfall currently uses the
transaction event JSON to populate these properties when they're
present. With this change we can use EAP instead, allowing us to break
the dependency on transaction events (facilitating transaction ingestion
shutdown).

Will always be missing for span streaming SDKs as expected, as those use
attributes and logs for this data instead.

See BROWSE-673.
mjq added a commit to getsentry/sentry that referenced this pull request Aug 7, 2026
Transaction events' `contexts`, `extra`, and `breadcrumbs` are now
deprecated under span streaming (replaced with attributes, attributes,
and logs, respectively). However, SDKs that are still sending this data
should still have it visible.

These transaction fields are serialized to attributes in Relay
(getsentry/relay#6286) and then emitted by the
trace item details API
(#121461). Use them in
preference to the transaction event. We keep reading the transaction
event so that data predating this data being written to EAP (Aug 6,
2026) continue to work.

Note that:
- The `Request` section is now missing, whether from a transaction event
or EAP. All this data is already written to attributes (from a
transaction or a streaming span) so it hasn't disappeared, it's just in
a new form.
- EAP currently lacks the `_meta` equivalent for these fields, so we've
lost annotations for redactions, etc when this data is sourced from EAP.
I'm going to restore this soon
(getsentry/relay#6296), but I don't want to wait
for it (better to show the data without annotations than to have no data
at all).

Fixes BROWSE-673.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants