fix(browser): simplify orchestrator otel carrier#10283
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Opening /__vitest_test__/ without ?sessionId is allowed for preview, but for otelCarrier, it's legitimate to require proper sessionId -> session mapping on server side.
There was a problem hiding this comment.
To be honest, I have no idea how sessionId-less orchestrator is meant to work. Probably we should revisit the proper invariant around these fallback.
There was a problem hiding this comment.
I think it just picks up the first available one
1b8c147 to
d916650
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors how OpenTelemetry context (otelCarrier) is propagated to the browser orchestrator, switching from URL query parameter propagation to server-side session storage keyed by sessionId.
Changes:
- Store
otelCarrieron the server-side browser session object when creating a browser session. - Stop appending
otelCarrierto the orchestrator URL query parameters. - Inject
__VITEST_OTEL_CARRIER__into orchestrator HTML from the server-side session instead ofurl.searchParams.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/vitest/src/node/types/browser.ts | Extends BrowserServerStateSession to optionally include otelCarrier. |
| packages/vitest/src/node/project.ts | Stops adding otelCarrier to the orchestrator URL; passes it into session creation instead. |
| packages/vitest/src/node/browser/sessions.ts | Adds optional otelCarrier to the created session record via createSession options. |
| packages/browser/src/node/serverOrchestrator.ts | Reads otelCarrier from the server-side session and injects it into the orchestrator client payload. |
Description
It looks like I had a weird indirection to propagate
otelCarrierto orchestrator #9180.Previously it did:
?otelCarrier=...as orchestrator page (along with?sessionId=...)?otelCarrierfrom request, which then inject back to shell htmlThis now becomes:
?sessionId=.... we recordotelCarrieron server side session object.otelCarrierassociated withsessionIdon the server side.How to test
Manually verified running
examples/opentelemetryscreenshot
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.