Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/browser/src/integrations/graphqlClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ function _updateSpanWithGraphQLData(client: Client, options: GraphQLClientOption
return;
}

const httpUrl = spanAttributes[SEMANTIC_ATTRIBUTE_URL_FULL] || spanAttributes['http.url'];
// Fall back to the `url` attribute too: the fetch instrumentation only
// sets `url.full` / `http.url` for absolute URLs, but populates `url`
// for relative GraphQL endpoints. Without this fallback the integration
// silently skips relative endpoints. (#20292)
const httpUrl =
spanAttributes[SEMANTIC_ATTRIBUTE_URL_FULL] ||
spanAttributes['http.url'] ||
spanAttributes['url'];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix PR lacks regression test for relative URLs

Low Severity

This fix PR adds a fallback to spanAttributes['url'] for relative GraphQL endpoints but does not include any unit, integration, or e2e test that verifies the fix. The existing integration tests (in dev-packages/browser-integration-tests/suites/integrations/graphqlClient/) only use absolute URLs like http://sentry-test.io/foo. A regression test exercising a relative endpoint (e.g., /graphql) would confirm the fix works and prevent future regressions. Per the project review rules, fix PRs are expected to include at least one test covering the regression being fixed.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 87cc443. Configure here.

const httpMethod = spanAttributes[SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD] || spanAttributes['http.method'];

if (!isString(httpUrl) || !isString(httpMethod)) {
Expand Down
Loading