feat(tanstackstart-react): Trace server routes#18546
feat(tanstackstart-react): Trace server routes#18546nicohrubec wants to merge 4 commits intodevelopfrom
Conversation
size-limit report 📦
|
| return target.apply(thisArg, args); | ||
| }, | ||
| ); | ||
| }, |
There was a problem hiding this comment.
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.
Not sure if this is the correct op or if we should use something tanstack specific here
|
As discussed offline: At the moment, these add no value on top of the base http spans we are getting from the http integration. I'd suggest to wait with this until it's clearer how we can parametrize routes and then probably instead of starting a span, we'd probably want to update the name of the http span. |
|
Pushing this back until we have figured if we can get parametrized routes, closing for now. |
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