Skip to content

fix(browser): enrich graphqlClient spans for relative URLs - #20296

Closed
SAY-5 wants to merge 1 commit into
getsentry:developfrom
SAY-5:feat/graphql-client-relative-url
Closed

fix(browser): enrich graphqlClient spans for relative URLs#20296
SAY-5 wants to merge 1 commit into
getsentry:developfrom
SAY-5:feat/graphql-client-relative-url

Conversation

@SAY-5

@SAY-5 SAY-5 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Per #20292, graphqlClientIntegration silently skips spans for relative GraphQL endpoints because the fetch instrumentation only sets url.full / http.url for absolute URLs. For relative URLs it sets the url attribute instead, so the existing chain in graphqlClient.ts reads undefined and bails before enriching the span.

Fall back to spanAttributes['url'] so relative GraphQL endpoints get enriched the same way as absolute ones.

Closes #20292

Per #20292, graphqlClientIntegration silently skips spans for relative
GraphQL endpoints because the fetch instrumentation only sets
`url.full` / `http.url` for absolute URLs. For relative URLs it sets
the `url` attribute instead.

Fall back to `spanAttributes['url']` so relative GraphQL endpoints
get enriched the same way as absolute ones.

Closes #20292
@sdk-maintainer-bot sdk-maintainer-bot Bot added missing-maintainer-discussion Used for automated community contribution checks. violating-contribution-guidelines Used for automated community contribution checks. labels Apr 15, 2026
@sdk-maintainer-bot

Copy link
Copy Markdown

This PR has been automatically closed. The referenced issue does not show a discussion between you and a maintainer.

To avoid wasted effort on both sides, please discuss your proposed approach in the issue first and wait for a maintainer to respond before opening a PR.

Please review our contributing guidelines for more details.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-maintainer-discussion Used for automated community contribution checks. violating-contribution-guidelines Used for automated community contribution checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

graphqlClientIntegration does not enrich spans for relative URLs

1 participant