Skip to content

[RUM-11993] Add trace context and GraphQL fields to sendErrorEvent#2798

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intodevelopfrom
sara.susano/RUM-11993-error-event-trace-graphql-fields
Apr 8, 2026
Merged

[RUM-11993] Add trace context and GraphQL fields to sendErrorEvent#2798
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intodevelopfrom
sara.susano/RUM-11993-error-event-trace-graphql-fields

Conversation

@saraSr5
Copy link
Copy Markdown
Contributor

@saraSr5 saraSr5 commented Mar 27, 2026

What

Adds trace context (traceId, spanId, parentSpanId, rulePsr) and GraphQL fields to sendErrorEvent in RUMResourceScope, bringing it to parity with sendResourceEvent.

Why

These fields were missing from the error event path, causing trace correlation and GraphQL error data to be lost when a resource load fails.

Changes

  • Regenerated RUMDataModels and Obj-C bridge to add the new fields to RUMErrorEvent
  • Added trace context and GraphQL extraction to sendErrorEvent
  • Extracted shared helpers extractTraceAttributes() and extractGraphQLAttributes() to eliminate duplication between the two send paths
  • Refactored GraphQL error parsing into a shared decodeGraphQLResponseErrors base with two typed wrappers
  • Added 13 tests covering all new fields and edge cases

@saraSr5 saraSr5 force-pushed the sara.susano/RUM-11993-error-event-trace-graphql-fields branch from 3641cae to 256edf5 Compare March 27, 2026 11:24
@saraSr5 saraSr5 marked this pull request as ready for review March 30, 2026 09:24
@saraSr5 saraSr5 requested review from a team as code owners March 30, 2026 09:24
Copy link
Copy Markdown
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Great work! Looks very good and very well covered in tests 🥇

I think we can improve the RUMResourceScope implementation by using a shared type for Graphql data, see my comment.

@saraSr5 saraSr5 requested a review from maxep March 31, 2026 10:27
maxep
maxep previously approved these changes Apr 1, 2026
Copy link
Copy Markdown
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Looks great! Just a minor suggestion

Copy link
Copy Markdown
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

Well done!

@saraSr5 saraSr5 requested a review from Copilot April 6, 2026 14:25
@saraSr5 saraSr5 review requested due to automatic review settings April 6, 2026 14:25
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot merged commit ef5e151 into develop Apr 8, 2026
24 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d bot deleted the sara.susano/RUM-11993-error-event-trace-graphql-fields branch April 8, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants