feat(orchestrator): tag envd-init meters with start_type#3125
Conversation
Add a start_type attribute (create/resume/reboot) to the two core envd-init meters orchestrator.sandbox.envd.init.calls and orchestrator.sandbox.envd.init.duration so create, resume, and reboot starts can be distinguished in Grafana. The value already flows into WaitForEnvd; thread it through to initEnvd and the duration histogram.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR SummaryLow Risk Overview The existing Reviewed by Cursor Bugbot for commit 35085d2. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Code Review
No critical findings or correctness issues were identified in this pull request.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
❌ 5 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
LGTM — small observability change threading the existing StartType through to the envd-init meters, mirroring the established pattern.
Extended reasoning...
Overview
This PR adds a start_type attribute (create/resume/reboot) to two existing meters: orchestrator.sandbox.envd.init.calls (counter, in envd.go) and orchestrator.sandbox.envd.init.duration (histogram, in sandbox.go). It threads the already-existing StartType parameter from WaitForEnvd into initEnvd and appends one attribute.String("start_type", ...) to each meter's attribute set. The StartType type itself, and its use for the uffd.startup.* metrics, already landed in the previous PR (f2ad0af).
Security risks
None — purely an observability/labeling change. No auth, crypto, network, or permission code is touched.
Level of scrutiny
Low. This is a mechanical telemetry tweak: one new function parameter threaded through one call site, and two single-line attribute additions. There is no control-flow change, no behavior change visible to the sandbox or to callers, and the meter names/types are unchanged. The label cardinality added is bounded by the three StartType constants.
Other factors
The bug hunter only flagged a nit: the StartType doc comment at sandbox.go:60-61 still enumerates only orchestrator.sandbox.uffd.startup.* and now under-reports the meters tagged with start_type. That is purely a comment-staleness issue with no runtime impact and does not warrant blocking the PR.
Conclusion
Simple, low-risk, self-contained — safe to approve without a human reviewer.
The StartType doc comment listed only the uffd.startup.* metrics and under-reported the envd-init meters now tagged with start_type. Make it meter-agnostic to avoid future staleness.
Add a start_type attribute (create/resume/reboot) to the two core envd-init meters orchestrator.sandbox.envd.init.calls and orchestrator.sandbox.envd.init.duration so create, resume, and reboot starts can be distinguished in Grafana. The value already flows into WaitForEnvd; thread it through to initEnvd and the duration histogram.