Repository navigation
fix(v10/browser): Apply urlQueryParams to event URLs, static span names and LCP URLs - #25297
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
…ames and LCP URLs Backport of: #25262
Contributor
size-limit report 📦
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of: #25262
Differences to the original PR
browser-utilslayout. Theperformance/entries.tsandweb-vitals/tracking.tschanges went intosrc/metrics/browserMetrics.ts. Theweb-vitals/spans.tschange went intosrc/metrics/webVitalSpans.ts. The filtering is the same._addPerformanceNavigationTiming/_addRequestset nourl.fullattribute and have no span-streaming name branch. So only the spannameis now filtered (filterCollectedUrl(entry.name))._sendLcpSpan(webVitalSpans.ts): on v10 this function takes noclientparameter.filterCollectedUrl(entry.url)falls back togetClient().src/metrics/lcp.ts(_sendStandaloneLcpSpan) now filters itslcp.urlattribute too. This standalone LCP span code exists only on v10 (it was removed on develop). Without this change it would still send the unfiltered LCP URL. This matches the original PR's goal of filteringlcp.url.httpcontext.ts: v10 spreads...reqDataintoevent.requestinstead of settingurlexplicitly. The backport addsurl: filterCollectedUrl(reqData.url, client)after the spread and before...event.request, so a URL the user set still wins.preprocessEventnow takes theclientargument.browserMetrics.test.tscases are intest/browser/browserMetrics.test.ts. They checkdescription/data, notname/attributes.url.full. To share it with the new case, the navigationentryfixture moved todescribescope._sendLcpSpanexpectation update is intest/metrics/webVitalSpans.test.ts. No client mock is needed.test/metrics/lcp.test.tsgets the same query-param expectation for the standalone LCP span.httpcontext.test.tscases were added at the top level, because v10 has nodataCollectiondescribe block.web-vitals-lcp-staticsuite maps to v10'sweb-vitals-lcp(static is the default there).pageload-sensitive-query-params-statictest uses string ops ('pageload','browser.request','resource.img'). v10's@sentry/conventions@0.16.0doesn't exportBROWSER_REQUEST/PAGELOAD/RESOURCE_IMGfrom@sentry/conventions/op.httpContextintegration test importswaitForErrorRequest/envelopeRequestParser, which v10's version didn't import yet.Verification
yarn format,yarn lint:fix(0 warnings, 0 errors) andyarn build:devall pass.browser-utils(browserMetrics,lcp,webVitalSpans),browser(browserTracingIntegration) andnextjs(pagesRouterInstrumentation).browserhttpcontext.test.tspassed (5/5) only with a temporary local workaround. Under the sandbox's Node 22, the existingglobalThis.navigator = …setup throws, and it does the same on unmodified v10. The repo pins Node 20.via Junior system actor
junior.--
View Junior Session [Sentry]