Repository navigation
Conversation
With 100K+ teams and growing, orchestrator failure logs that only carry the sandboxID cannot be filtered or aggregated by team at scale. This adds logger.WithTeamID to the error/warn logs where the team is already in scope (no new DB lookup, no signature change), following the same shape as e2b-dev#3674: - routing/publisher.go: failed to publish / delete sandbox routing record - sandbox/hoststats_collector.go: push baseline / collect sample / final sample - sandbox/oom.go: failed to seed the OOM kill watermark - sandbox/reboot.go: ignoring invalid reboot CPU template override - server/prefetch_harvest.go: resume prefetch harvest failed; stop/close throwaway - server/checkpoint_detached.go: left the live map before the kill teamID is taken from the runtime/metadata already held at each site (sbx.Runtime.TeamID / runtime.TeamID / h.metadata.TeamID). Logs whose scope has no team handle (fc process teardown, network slot release, cgroup FD release, template build) are intentionally left unchanged. Revives the intent of e2b-dev#3674 (closed) against current main, extended beyond the two create-path logs to the failure logs across the sandbox lifecycle.
AdaAibaby
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
October 23, 2026 00:53
… logs Follow-on within the same PR: the three failure logs that previously could not carry teamID without a struct/signature change now do. - sandbox.go releaseCgroupFD: add a teamID parameter (both call sites already hold runtime.TeamID) so the cgroup FD release warning is team-labelled. - fc/process.go teardown warnings (remove metrics FIFO, SIGTERM, SIGKILL): use the teamID the Process already holds (NewProcess receives it for metrics), so no new plumbing is needed. - network/slot.go: Slot gains a teamID field set by AssignSandbox(sandboxID, teamID) and cleared on release; getNetworkSlot threads runtime.TeamID through so the non-DNS-UDP slot log is team-labelled. Test call sites updated for the new signatures. Note on envd: the two envd-init error logs from the original e2b-dev#3674 are NOT touched here — on current main they log through s.log() (= Runtime.Logger()), whose LogFields() already emits WithTeamID on every line, so adding it explicitly would duplicate the field. The create-path log e2b-dev#3674 targeted is likewise already covered by the sites in the previous commit. Intentionally left out: fc vcpu telemetry spans (telemetry.ReportError, trace-level, already correlatable) and the sandboxtools command path (bare sandboxID threaded through ~10 call sites for low-value Debug/span lines).
This branch has not been deployed
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.
Revives the intent of #3674 (add
teamIDto orchestrator failure logs) against currentmain, and extends it beyond the two create-path logs to the failure logs across the whole sandbox lifecycle.Why
With 100K+ teams and a goal of 1M+, orchestrator failure logs that carry only
sandboxIDcan't be filtered or aggregated by team at scale. AddingteamIDto the error/warn logs where the team is already in scope makes per-team failure debugging and alerting possible with no runtime cost.What
logger.WithTeamID(...)added to the following error/warn logs — no new DB lookup, no signature change, teamID taken from the runtime/metadata already held at each site:routing/publisher.go(×2)sbx.Runtime.TeamIDsandbox/hoststats_collector.go(×3)h.metadata.TeamIDsandbox/oom.goc.sandbox.Runtime.TeamIDsandbox/reboot.goruntime.TeamIDserver/prefetch_harvest.go(×3)sbx.Runtime.TeamID/runtime.TeamIDserver/checkpoint_detached.golive.Runtime.TeamIDIntentionally left unchanged
Logs whose scope has no team handle are not touched, to keep this to the zero-cost shape of #3674 (no struct/signature changes): fc process teardown (
SandboxFileshas no team field), network slot release (Slotholds onlysandboxID), cgroup FD release (takes onlysandboxID), and template build. Wiring team into those would be a separate, larger change.Verification
go build ./...andgo vetpass. Net change: 6 files, 11WithTeamIDadditions.