-
Notifications
You must be signed in to change notification settings - Fork 74
RUM-13564: Add GraphQL errors support to RUM resource events #3097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
90cbf43 to
f8c49e5
Compare
This comment has been minimized.
This comment has been minimized.
...ndroid-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt
Outdated
Show resolved
Hide resolved
...ndroid-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt
Outdated
Show resolved
Hide resolved
...ndroid-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt
Outdated
Show resolved
Hide resolved
...ndroid-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt
Outdated
Show resolved
Hide resolved
...ndroid-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt
Outdated
Show resolved
Hide resolved
...ndroid-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt
Outdated
Show resolved
Hide resolved
...ndroid-rum/src/main/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScope.kt
Outdated
Show resolved
Hide resolved
...id-rum/src/test/kotlin/com/datadog/android/rum/internal/domain/scope/RumResourceScopeTest.kt
Outdated
Show resolved
Hide resolved
| 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
f8c49e5 to
b5f4592
Compare
What does this PR do?
Adds GraphQL errors support to RUM resource events. Extracts and parses GraphQL errors from the
_dd.graphql.errorsattribute, and populatesresource.graphql.errorsandresource.graphql.error_countfields 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)