Add telemetry support to browser-pools CLI commands#205
Draft
Sayan- wants to merge 2 commits into
Draft
Conversation
Bring the CLI to parity with the API/SDK telemetry surface for browser pools: --telemetry on browser-pools create/update/acquire, display the active config in browser-pools get, and forward --telemetry as an acquire override on browsers create --pool-id/--pool-name. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Replace five near-identical all/off/categories switches (browser create/update + pool create/update/acquire) with a single resolveTelemetryFlag resolver and thin per-endpoint adapters, so the --telemetry flag grammar has one source of truth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Brings the CLI to parity with the API/SDK browser-pool telemetry surface (shipped in kernel-go-sdk v0.79.0).
What changed
kernel browser-pools create --telemetry=all|off|<categories>— set the telemetry config applied to browsers warmed into the pool.kernel browser-pools update --telemetry=...— update pool telemetry (applies only to browsers warmed after the update).kernel browser-pools acquire --telemetry=...— per-lease telemetry override, merged onto the pool config.kernel browser-pools get— now displays the pool's active telemetry in the details table.kernel browsers create --pool-id/--pool-name --telemetry=...—--telemetryis now an allowed per-lease flag (previously treated as a conflicting config flag and ignored) and is forwarded as an acquire override.kernel-go-sdkto v0.79.0.The flag semantics reuse the existing single-browser telemetry parsing (
all/off/ comma-separated category list), so pool and browser telemetry behave identically.Testing
go test ./...passes.all/off/category and invalid-category paths, and the shared acquire builder.go vet ./...clean.🤖 Generated with Claude Code
Code quality pass
build*TelemetryParamsiblings, guards are idiomatic Go, no casts/dead code.all/off/categories switch builders (browser create/update + pool create/update/acquire) into a singleresolveTelemetryFlagresolver with thin per-endpoint adapters. The flag grammar now has one source of truth (case "all"appears exactly once in the codebase).Live test plan (built from this branch, run against the API with a real key)
Built
bin/kerneloff this branch and exercised every new path end-to-end:browser-pools create --telemetry=console,networkbrowser-pools get(table)Telemetryrow rendersconsole, network, control, connection, system, captchabrowser-pools update --telemetry=allgetconfirmsbrowser-pools update --telemetry=offgetshowsTelemetry: disabledbrowser-pools acquire --telemetry=page(pool telemetry off)page+ operational — override reaches the actual browser (verified viabrowsers get <session>)browser-pools update --telemetry=bogusbrowsers create --pool-name … --telemetry=consoleconsole+ operationalbrowsers create --pool … --telemetry=nope--telemetryoncreateAll warmed browsers were released and the test pool deleted.
go build ./...,go test ./..., andgo vet ./...all pass.