From 87cc443a522d46b75af01beeadcedff6b9138c9c Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Tue, 14 Apr 2026 22:08:52 -0700 Subject: [PATCH] fix(browser): enrich graphqlClient spans for relative URLs 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 --- packages/browser/src/integrations/graphqlClient.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/browser/src/integrations/graphqlClient.ts b/packages/browser/src/integrations/graphqlClient.ts index d256fa6b72e1..756f4cb18a03 100644 --- a/packages/browser/src/integrations/graphqlClient.ts +++ b/packages/browser/src/integrations/graphqlClient.ts @@ -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']; const httpMethod = spanAttributes[SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD] || spanAttributes['http.method']; if (!isString(httpUrl) || !isString(httpMethod)) {