You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #5420. Phase 2 — behavior-neutral consumer migration.
Migrate the GraphQL client instrumentation to GraphQL.Document / GraphQL.Variables:
src/Sentry/SentryGraphQLHttpFailedRequestHandler.cs:67-80 — request query body (sentryRequest.Data) and response body currently gated on SendDefaultPii; split gating: document vs variables per spec.
Note the JS default: graphQL remains true even in the legacy-false bridge, because documents were historically attached (with redaction) — verify what sentry-dotnet's historical behavior implies for the bridge here (today the .NET handler attaches the body only when SendDefaultPii is true, so the .NET bridge should map false → GraphQL off, unlike JS).
Legacy-gate accessors needed here too, beyond the GraphQL document
Noting what reviewing #5885 turned up (thanks @ric-oliv). SentryGraphQLHttpFailedRequestHandler gates far more than the document on SendDefaultPii — when it is off, it attaches no request or response headers, neither cookie set, no request body and no response body, and strips user:pass@ and the fragment from Request.Url:
Corrected 2026-11-10, again thanks to @ric-oliv: an earlier version of this note said the off branch "reduces Request.Url to scheme + host + path" and asked for a UrlQueryParamsWithLegacyPiiGate accessor. HttpRequestUrl() keeps the query string, so the URL gate here is about credentials, not query params. The accessor list below is rewritten, and the count drops from three to two.
if(!_options.SendDefaultPii){sentryRequest.Url=request.RequestUri?.HttpRequestUrl();// keeps ?query; drops user:pass@ and #fragment}else{sentryRequest.Cookies=request.Headers.GetCookies();sentryRequest.Data=requestContent?.RequestContent;sentryRequest.Url=request.RequestUri?.AbsoluteUri;sentryRequest.AddHeaders(request.Headers);responseContext.Cookies=response.Headers.GetCookies();responseContext.Data=json;responseContext.AddHeaders(response.Headers);}
DataCollectionResolver's global RequestHeaders / ResponseHeaders fall back to a plain DenyList() regardless of SendDefaultPii, because that matches the server-side capture path. Wiring this handler to them would start sending those headers for SendDefaultPii = false apps.
Cookies needs nothing extra — its global fallback is already Off when SendDefaultPii is false.
The bodies are already right: OutgoingRequestBody and IncomingResponseBody both fall back to SendDefaultPii, which is precisely what gates sentryRequest.Data and responseContext.Data above.
UrlQueryParams needs no gated variant, and covers both URL fields. HttpRequestUrl() keeps the query and Request.QueryString is set unconditionally outside the if, so the query reaches Sentry either way today; the global accessor keeps it flowing and filters the denylisted keys. SentryGraphQlHttpFailedRequestHandlerTests.cs:150 pins http://localhost/test/path?query=string with PII off, which a gated accessor resolving to Off would break.
The document/variables split (GraphQLDocument, GraphQLVariables) is unchanged from the issue description: both fall back to SendDefaultPii, matching sentryRequest.Data.
Activity
linear-code commentedon Jul 22, 2026
NET-767
jamescrosswell commentedon Nov 8, 2026
Legacy-gate accessors needed here too, beyond the GraphQL document
Noting what reviewing #5885 turned up (thanks @ric-oliv).
SentryGraphQLHttpFailedRequestHandlergates far more than the document onSendDefaultPii— when it is off, it attaches no request or response headers, neither cookie set, no request body and no response body, and stripsuser:pass@and the fragment fromRequest.Url:DataCollectionResolver's globalRequestHeaders/ResponseHeadersfall back to a plainDenyList()regardless ofSendDefaultPii, because that matches the server-side capture path. Wiring this handler to them would start sending those headers forSendDefaultPii = falseapps.What this needs:
RequestHeadersWithLegacyPiiGateandResponseHeadersWithLegacyPiiGate— eachConfigured?.<category> ?? (SendDefaultPii ? DenyList : Off). DataCollection phase 2: migrate redact cascade and HTTP failed-request handler #5429 needs exactly these two forSentryHttpFailedRequestHandler, so whichever lands first adds them.Cookiesneeds nothing extra — its global fallback is alreadyOffwhenSendDefaultPiiis false.OutgoingRequestBodyandIncomingResponseBodyboth fall back toSendDefaultPii, which is precisely what gatessentryRequest.DataandresponseContext.Dataabove.UrlQueryParamsneeds no gated variant, and covers both URL fields.HttpRequestUrl()keeps the query andRequest.QueryStringis set unconditionally outside theif, so the query reaches Sentry either way today; the global accessor keeps it flowing and filters the denylisted keys.SentryGraphQlHttpFailedRequestHandlerTests.cs:150pinshttp://localhost/test/path?query=stringwith PII off, which a gated accessor resolving toOffwould break.user:pass@and fragment question is DataCollection phase 2: migrate redact cascade and HTTP failed-request handler #5429's to settle — see the credentials section of that note. Whatever it decides applies here verbatim: both handlers have the identicalHttpRequestUrl()/AbsoluteUrisplit, andRedactUrlreaches neither.The document/variables split (
GraphQLDocument,GraphQLVariables) is unchanged from the issue description: both fall back toSendDefaultPii, matchingsentryRequest.Data.ref(graphql): Gate GraphQL headers, cookies and query params on DataC…
fix(graphql): Always filter credentials from GraphQL failed-request URLs
fix(graphql): Send the request URL fragment only with SendDefaultPii …
ref(graphql): Log dropped GraphQL request bodies and document what Va…
fix(graphql): Filter the failed-request URL fragment like the query
fix(graphql): Drop GraphQL request bodies with a lone UTF-16 surrogat…
feat: DataCollection now gates GraphQL error events, with separate do…