Repository navigation
feat(solid): Turn Solid 2 observe build records into spans - #26794
Conversation
|
bugbot run |
size-limit report 📦Compared: 8027f92 (PR test merge using develop at abd9eca) Against: abd9eca (develop) · base run #68109 ✅ Baseline matches: this diff contains only this PR's changes.
|
Optional E2E testsAll optional checks were successful. 5 successful. See the run. Successful checks
|
e6547fd to
c79d7f4
Compare
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 99a9876. Configure here.
| */ | ||
| function nameRequestAfterRenderRoute({ route }: RenderEvent): void { | ||
| const activeSpan = getActiveSpan(); | ||
| if (!route?.name || !activeSpan) { |
There was a problem hiding this comment.
could we skip renders without route.params as well (Solid does not add this when no route matches)? otherwise we would use the raw path and attach route as the source (below), but we have no route that matches here.
| if (!route?.name || !activeSpan) { | |
| if (!route?.name || !route.params || !activeSpan) { |
There was a problem hiding this comment.
Good catch, the router reports the raw path as the name with no params when nothing matched. Applied in 792be89, with a test.
Solid 2 observe and dev builds record every server function execution and the route each server render resolved to. solidServerObserveIntegration, on by default on Node and Workers, adds a function span for each execution, and names the request span after the render's route when the router wrapper did not. Production builds have no records, so it does nothing there. Refs JS-4118 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…@sentry/core The span lint rule counts all of @sentry/solid as browser code, but this module only runs on the server. Refs JS-4118 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs JS-4118 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
performanceTimeToSeconds corrects for clock drift like the request span's timestamps, and skips the span when there is no usable time origin. Refs JS-4118 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without a match, the router reports the raw path as the route name and no params, so naming the span after it with source route was wrong. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
792be89 to
97eb5b2
Compare
What
On Solid 2 observe and dev builds, every server function execution gets a
functionspan, and the request span is named after the route the render resolved to (GET /user/:id), also withoutwithSentryRouterRouting. Production builds are unchanged.Why
Observe builds record these facts already, so they are free to read. The span uses the
functionop, like server actions and loaders in other SDKs, so no new attributes are needed.The span is made after the server function finished. So spans from inside the function, like a database query, show up next to it, not under it. Fixing that needs a hook that Solid gives to apps, so we leave it for later.
Refs JS-4118