Skip to content

Conversation

@cdn34dd
Copy link
Contributor

@cdn34dd cdn34dd commented Jan 4, 2026

What does this PR do?

Adds GraphQL errors support to RUM resource events. Extracts and parses GraphQL errors from the _dd.graphql.errors attribute, and populates resource.graphql.errors and resource.graphql.error_count fields in RUM event data.

Motivation

Achieve cross-platform parity with iOS SDK. React Native SDK sends GraphQL errors from JS, but Android wasn't parsing them, resulting in missing error data.

Additional Notes

This supports both wrapped errors format (e.g., _dd.graphql.errors: {"errors": [...]}) and direct array format (e.g., _dd.graphql.errors: [...] ) for flexibility. iOS only accepts the wrapped format, which was surprising given the the shape of the data, so here both work.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@cdn34dd cdn34dd requested a review from a team as a code owner January 4, 2026 13:50
@cdn34dd cdn34dd force-pushed the carlosnogueira/RUM-13564/graphql-errors-support branch from 90cbf43 to f8c49e5 Compare January 4, 2026 14:52
@datadog-datadog-prod-us1

This comment has been minimized.

val graphqlOperationName = resourceAttributes.remove(RumAttributes.GRAPHQL_OPERATION_NAME) as? String
val graphqlOperationType = resourceAttributes.remove(RumAttributes.GRAPHQL_OPERATION_TYPE) as? String
val graphqlVariables = resourceAttributes.remove(RumAttributes.GRAPHQL_VARIABLES) as? String
val graphqlErrors = resourceAttributes.remove(RumAttributes.GRAPHQL_ERRORS) as? String
Copy link
Contributor

Choose a reason for hiding this comment

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

Question. Where is this attribute set? IIUC Android SDK currently doesn't process errors from GraphQL response.

Or will this PR only work for React Native SDK, because it sets these attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're setting these attributes in react-native yes and we need the android SDK to also parse the errors we set in those attributes similar to what's currently done on iOS.

@cdn34dd cdn34dd force-pushed the carlosnogueira/RUM-13564/graphql-errors-support branch from f8c49e5 to b5f4592 Compare January 8, 2026 07:53
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.

4 participants