Repository navigation
feat(sandbox): telemetry on installed deps per sandbox install - #4269
Merged
Merged
Conversation
Log the flattened name@version dependency set (read from on-disk node_modules, PM-agnostic) as one JSON line per successful install so the team can decide which packages to pre-bake into the sandbox image. Adds low-cardinality metrics (install counter + dependency-count histogram); package name/version are NEVER metric labels.
Contributor
There was a problem hiding this comment.
1 issue found across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
pedrofrxncx
enabled auto-merge (squash)
July 2, 2026 20:55
pedrofrxncx
disabled auto-merge
July 2, 2026 20:59
The daemon has no MeterProvider/exporter (only @opentelemetry/api), and sandbox pods can't reach an in-cluster OTLP collector (egress locked to 53/443), so the counter/histogram never left the process. The stdout JSON log line is the only channel that reaches VictoriaLogs.
pedrofrxncx
enabled auto-merge (squash)
July 2, 2026 21:06
pedrofrxncx
disabled auto-merge
July 2, 2026 21:06
decocms Bot
pushed a commit
that referenced
this pull request
Jul 2, 2026
PR: #4269 feat(sandbox): telemetry on installed deps per sandbox install Bump type: minor - @decocms/sandbox (packages/sandbox/package.json): 1.8.3 -> 1.9.0 Deploy-Scope: both
This was referenced Jul 2, 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.
Summary
Adds observability-only telemetry on which dependencies get installed in each sandbox, so the team can decide which packages to pre-bake into the sandbox image. No change to install behavior; no shared cache.
After a successful install (
stepInstall, exit 0), the daemon reads the flattened installed dependency set and emits it. Install behavior, gating, and skip logic are untouched — the emit is a fire-and-forget, best-effort side effect that never throws.What it emits
msg: "sandbox.install.deps") with:bootId,packageManager,repoName,branch,dependencyCount, anddependencies: [{ name, version }]. Aggregated downstream in VictoriaLogs.link-daemonmeter (no new OTel dep):sandbox_install_totalcounter andsandbox_install_dependency_counthistogram, labeled only bypackage_manager.How the dep set is read
PM-agnostic: walks the on-disk
node_modulesviaBun.Glob("**/package.json")(followSymlinks: false,dot: true) and collects{name, version}, deduped. This covers npm / pnpm / yarn / bun with one code path — pnpm's real package dirs under.pnpm/are picked up while its top-level symlinks are skipped, so every PM yields the same flattened set. A small filter (isPackageManifest, unit-tested) rejects fixture/samplepackage.jsonfiles shipped inside packages. Chose reading node_modules over parsing four different lockfile formats: smaller diff, uniform coverage, and it reflects what actually landed on disk.Where it's hooked
packages/sandbox/daemon/setup/orchestrator.ts→stepInstall(), right aftermarkInstallSucceeded()on the exit-0 path. Identifiers come from what's already in that code path:DAEMON_BOOT_ID(the daemon's existing log correlation key) + repo name/branch from config. New helper:packages/sandbox/daemon/setup/dep-metrics.ts.Testing
bun run check(typecheck) cleanbun test daemon/setup— existing orchestrator/clone tests pass; addeddep-metrics.test.tsfor the manifest filterbun run lint— 0 errors🤖 Generated with Claude Code
Summary by cubic
Adds observability-only telemetry that records which dependencies were installed after a successful sandbox install. No changes to install behavior or caching.
New Features
msg: "sandbox.install.deps") withbootId,packageManager,repoName,branch,dependencyCount, anddependencies: [{ name, version }].node_modulesto build a deduped dep set (works fornpm/pnpm/yarn/bun); excludes fixture/sample manifests via a small, tested filter.stepInstall()after a successful install; fire-and-forget and never throws.Bug Fixes
Written for commit 363a4f3. Summary will update on new commits.