fix(platform): Re-enable middleware span sampling - #18886
fix(platform): Re-enable middleware span sampling#18886sentry-junior[bot] wants to merge 1 commit into
Conversation
Stop hard-dropping Middleware.execute roots in tracesSampler so middleware spans are sampled again with the normal traffic rules. Keep docs.request.classified as the unsampled traffic counter. Co-Authored-By: Charly Gomez <charly.gomez@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Superseded by #18887 — same goal, different sampling shape. This PR removes #18887 keeps the detection and returns 1% instead of 0 (~24k/day), and additionally names the spans from inside Also carried your duplicate-child-span note over to #18887 as an open question — if that SDK behavior is real, actual volume there could be ~2x the estimate. Happy to raise the 1% if 24k/day turns out too thin for the investigation you had in mind. |
Summary
Re-enables middleware span ingestion on docs by removing the hard drop of Next.js
Middleware.executeroots intracesSampler.Why
#18775 intentionally sampled middleware roots at
0because they were unclassifiable noise at the time. We want middleware spans back for investigation / visibility.SDK instrumentation still emits
http.server.middlewareon current@sentry/nextjs— only the app sampler was suppressing them. No SDK bump required.Change
isMiddlewareRootSpanearly-return (return 0) fromsrc/tracesSampler.tsdocs.request.classifiedinmiddleware.tsas the unsampled request counterVerify after deploy
Should go non-zero on
sentry/docs.Risks
unknownwhen sampled before request headers are available, so volume can be higher than classifiable server spansTest plan
docs.request.classifiedstill flowsRequested by Charly Gomez via Junior.
--
View Junior Session