feat: implement agent_sandbox_creation_latency_ms metric#425
Conversation
✅ Deploy Preview for agent-sandbox canceled.
|
|
Hi @chw120. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
bfaba5a to
5e6e1aa
Compare
|
/easycla |
1 similar comment
|
/easycla |
|
@chw120 I don't think Jules signed the CLA . You might need to configured the Jules to use "User Only" mode to get rid of the co-authored. |
…on-latency-2507448849294936923
|
/assign igooch |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chw120, igooch The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…sigs#425) * feat: implement agent_sandbox_creation_latency_ms metric Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * fix(lint): remove redundant Time selector in sandboxclaim controller * address review comments * address review comments * added namespace and used early returns * fix: format --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
…sigs#425) * feat: implement agent_sandbox_creation_latency_ms metric Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> * fix(lint): remove redundant Time selector in sandboxclaim controller * address review comments * address review comments * added namespace and used early returns * fix: format --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This PR introduces the
agent_sandbox_creation_latency_msmetric to track the time it takes from a Sandbox's creation to when its associated Pod reaches a Ready state. This provides better visibility into the performance of sandbox provisioning across different launch types and templates.Key Changes
New Prometheus Histogram: Defined
SandboxCreationLatencyas a histogram vector ininternal/metrics/metrics.go.50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000, 60000, 120000, 240000).launch_type("warm", "cold", "unknown") andsandbox_templateto allow granular analysis.Note: I did not add "status" defined in the original requirement, since it would be always
success.Controller Integration: Updated the
SandboxClaimReconcilerinextensions/controllers/sandboxclaim_controller.goto calculate and record this latency during the reconciliation process. It specifically measures the duration betweensandbox.CreationTimestampand the Pod'sLastTransitionTimefor the Ready condition.Helper Method: Added
RecordSandboxCreationLatencyto the internal metrics package for clean invocation from controllers.Testing
TestSandboxLatencyRecordingininternal/metrics/metrics_test.goto ensure that observations are correctly recorded and grouped by their respective launch type labels.Working on #245