-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(tanstackstart-react): Trace server routes #18546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
size-limit report 📦
|
| return target.apply(thisArg, args); | ||
| }, | ||
| ); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Nested http.server spans duplicate root spans
Wrapping every serverEntry.fetch call in startSpan with op = 'http.server' creates a child http.server span when an incoming-request transaction is already active (e.g., from Node HTTP auto-instrumentation). This can produce duplicate http.server spans in a single trace and misleading timings/attributes because the inner span ends when the handler returns, not when the response finishes.
| ); | ||
| } else { | ||
| // API route or other server request | ||
| op = 'http.server'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the correct op or if we should use something tanstack specific here
This PR adds tracing for tss server routes (and other http server requests), by extending the implementation in the existing
wrapFetchWithSentrywrapper.Screenshot from my sample app for a server route request:

Tests added:
Closes #18284