Skip to content

RUM-14902: Track GraphQL errors#3275

Draft
kikoveiga wants to merge 1 commit intodevelopfrom
kikoveiga/RUM-14902/track-graphql-errors
Draft

RUM-14902: Track GraphQL errors#3275
kikoveiga wants to merge 1 commit intodevelopfrom
kikoveiga/RUM-14902/track-graphql-errors

Conversation

@kikoveiga
Copy link
Contributor

@kikoveiga kikoveiga commented Mar 18, 2026

What does this PR do?

  • Track GraphQL errors on DatadogInterceptor for OkHttp requests.
  • Create GraphQLExtractor with 2 main functions: extractGraphQLAttributes (already existing logic, moved from DatadogInterceptor for better separation of concerns) & extractGraphQLErrors (new logic). This is a reusable extraction in rum module that can be reused in the future with other networking libraries (no coupling with OkHttp).
  • Create OkHttpGraphQLAdapter to encapsulate some already existing logic and delegate to the class above.
  • Some cleanup (create StringExt on internal module to reuse String.toBase64 & String.fromBase64 extension functions).

Motivation

GraphQL APIs return HTTP 200 regardless of succeeding or not. Errors are reported inside the response body's errors array rather than through HTTP status codes.

Now these errors are properly caught, allowing customers to detect GraphQL failures that would otherwise go unnoticed.

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)

@kikoveiga kikoveiga force-pushed the kikoveiga/RUM-14902/track-graphql-errors branch from 80f5c87 to 135f9f0 Compare March 19, 2026 11:51
@datadog-official

This comment has been minimized.

@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 69.00000% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.47%. Comparing base (61409f2) to head (0395da9).

Files with missing lines Patch % Lines
...id/okhttp/internal/graphql/OkHttpGraphQLAdapter.kt 53.19% 21 Missing and 1 partial ⚠️
...va/com/datadog/android/internal/utils/StringExt.kt 0.00% 7 Missing ⚠️
...tadog/android/rum/internal/net/GraphQLExtractor.kt 94.59% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3275      +/-   ##
===========================================
- Coverage    71.62%   71.47%   -0.15%     
===========================================
  Files          942      945       +3     
  Lines        34811    34872      +61     
  Branches      5899     5906       +7     
===========================================
- Hits         24933    24924       -9     
- Misses        8241     8288      +47     
- Partials      1637     1660      +23     
Files with missing lines Coverage Δ
...datadog/android/apollo/DatadogApolloInterceptor.kt 93.10% <ø> (-0.44%) ⬇️
...n/com/datadog/android/okhttp/DatadogInterceptor.kt 80.56% <100.00%> (+5.20%) ⬆️
...tadog/android/rum/internal/net/GraphQLExtractor.kt 94.59% <94.59%> (ø)
...va/com/datadog/android/internal/utils/StringExt.kt 0.00% <0.00%> (ø)
...id/okhttp/internal/graphql/OkHttpGraphQLAdapter.kt 53.19% <53.19%> (ø)

... and 33 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kikoveiga kikoveiga force-pushed the kikoveiga/RUM-14902/track-graphql-errors branch 4 times, most recently from dd8d47f to dbfff5f Compare March 19, 2026 15:34
@kikoveiga kikoveiga force-pushed the kikoveiga/RUM-14902/track-graphql-errors branch from dbfff5f to 0395da9 Compare March 19, 2026 17:36
@kikoveiga kikoveiga self-assigned this Mar 20, 2026
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