feat: route browser telemetry directly to the VM by default#115
Merged
Conversation
|
Created a monitoring plan for this PR. What this PR does: Fixes the browser telemetry stream endpoint URL in the SDK ( Intended effect:
Risks:
Status updates will be posted automatically on this PR as monitoring progresses. |
Add "telemetry" to the default KERNEL_BROWSER_ROUTING_SUBRESOURCES list so
telemetry SSE streams are routed straight to the browser VM, and change the
telemetry stream method path from /browsers/{id}/telemetry to
/browsers/{id}/telemetry/stream so the direct-routing rewrite yields
{base_url}/telemetry/stream on the VM (the VM's /telemetry is a different,
non-streaming endpoint).
DEPENDS ON the control-plane PR renaming the public endpoint
/browsers/{id}/telemetry -> /browsers/{id}/telemetry/stream. Until that
deploys, telemetry.stream() only works via direct routing.
Verified with a live smoke test against prod: the telemetry stream request
is rewritten to the VM proxy host (.../telemetry/stream?jwt=...), the
Authorization header is stripped, and an api_call telemetry event arrives
within ~1s of generating activity.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ea93aa3 to
2030547
Compare
archandatta
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
client.browsers.telemetry.stream()now callsGET /browsers/{id}/telemetry/stream(was/browsers/{id}/telemetry). This mirrors the browser VM, where the SSE stream lives at{base_url}/telemetry/streamwhile{base_url}/telemetryis a different (non-streaming, JSON config) endpoint. With the new path, the direct-routing rewrite correctly yields{base_url}/telemetry/stream."telemetry"to the defaultKERNEL_BROWSER_ROUTING_SUBRESOURCESlist (['curl']->['curl', 'telemetry']), so telemetry streams route directly to the VM with no env var required.api.mdand the routing unit tests (default list assertion + a new test proving a telemetry call rewrites to{base_url}/telemetry/streamwith the Authorization header stripped).Depends on
The control-plane PR renaming the public endpoint
/browsers/{id}/telemetry->/browsers/{id}/telemetry/stream. That is not yet deployed to prod, so until it ships,telemetry.stream()only works via direct routing (a non-routed call to the new path 404s in prod). This also independently proves routing is doing the work.Live smoke evidence (prod)
Ran
examples/smoke-browser-telemetry.tsagainsthttps://api.onkernel.comwith an instrumented customfetch:https://proxy.yul-funny-austin.onkernel.com:8443/browser/kernel/telemetry/stream?jwt=...base_url(proxy host,:8443), notapi.onkernel.com/telemetry/stream;jwtquery param present;Authorizationheader strippedtype=api_call) within ~1s of generating activity viabrowsers.curlfinally🤖 Generated with Claude Code
Note
Medium Risk
Changes default fetch routing for telemetry SSE (auth stripped, VM URL rewrite); depends on control-plane
/telemetry/streambeing deployed for non-routed calls.Overview
Browser telemetry SSE now uses the same direct-to-VM routing as
curlby default:telemetryis included inDEFAULT_BROWSER_ROUTING_SUBRESOURCES, sobrowsers.telemetry.stream()is rewritten to{session base_url}/telemetry/streamwith ajwtquery param and without forwardingAuthorization.Tests assert the expanded default subresource list and that a telemetry stream request hits the VM path. A new
examples/browser-telemetry.tssample creates a browser with telemetry on, streams a few events aftercurlactivity, then deletes the session.Reviewed by Cursor Bugbot for commit 2030547. Bugbot is set up for automated code reviews on this repo. Configure here.