Skip to content

Conversation

@rgaignault
Copy link
Contributor

@rgaignault rgaignault commented Dec 3, 2025

Motivation

Our GraphQL server makes use of persisted queries for operations which means the query and operationType are not known when making calls to GQL which prevents us from being able to use the built in GQL tracking for enriching our resource events

example:


{
    "graphqlBody": {
        "operationName": "Navigation",
        "variables": {},
        "extensions": {
            "persistedQuery": {
                "version": 1,
                "sha256Hash": "0e669423cef683226cb8eb295664619c8e0f95945734e0a458095f51ee89efb3"
            }
        }
    }
}

Changes

Test instructions

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.

@rgaignault rgaignault requested a review from a team as a code owner December 3, 2025 10:09
@cit-pr-commenter
Copy link

cit-pr-commenter bot commented Dec 3, 2025

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 164.16 KiB 164.13 KiB -24 B -0.01%
Rum Profiler 4.84 KiB 4.84 KiB 0 B 0.00%
Rum Recorder 19.62 KiB 19.62 KiB 0 B 0.00%
Logs 55.96 KiB 55.96 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 121.42 KiB 121.40 KiB -24 B -0.02%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0053 0.0062 +16.98%
RUM - add action 0.0124 0.0148 +19.35%
RUM - add error 0.0113 0.0219 +93.81%
RUM - add timing 0.0027 0.0053 +96.30%
RUM - start view 0.0034 0.0067 +97.06%
RUM - start/stop session replay recording 0.0006 0.0009 +50.00%
Logs - log message 0.0126 0.0209 +65.87%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.33 KiB 25.25 KiB -1.08 KiB
RUM - add action 49.31 KiB 46.36 KiB -2.95 KiB
RUM - add timing 24.20 KiB 25.35 KiB +1.15 KiB
RUM - add error 54.02 KiB 50.91 KiB -3.11 KiB
RUM - start/stop session replay recording 24.25 KiB 24.15 KiB -103 B
RUM - start view 423.76 KiB 424.81 KiB +1.05 KiB
Logs - log message 44.60 KiB 44.55 KiB -50 B

🔗 RealWorld

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 105 to 109
if (graphqlBody && graphqlBody.extensions?.persistedQuery) {
return {
operationName: graphqlBody.operationName,
variables: graphqlBody.variables ? JSON.stringify(graphqlBody.variables) : undefined,
}

Choose a reason for hiding this comment

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

P1 Badge Restore operationType when persisted queries include a query

The new persisted-query branch returns early whenever extensions.persistedQuery is present, so requests that include both a persisted-query extension and a query string (e.g., the initial Apollo APQ round trip that sends hash and the full query) now skip the later query parsing and emit metadata without operationType or payload. Before this change these same requests produced full GraphQL metadata; after it, GraphQL resource events for those persisted queries lose operation type and payload information. Consider checking for extensions.persistedQuery only when no query is provided so requests that already contain a query keep their operation details.

Useful? React with 👍 / 👎.

@datadog-official
Copy link

datadog-official bot commented Dec 3, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 02e0cd8 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

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