Skip to content

Change ClaimStartupLatency to use an annotation for creation timestamp#540

Open
igooch wants to merge 2 commits intokubernetes-sigs:mainfrom
igooch:webhook-annotation
Open

Change ClaimStartupLatency to use an annotation for creation timestamp#540
igooch wants to merge 2 commits intokubernetes-sigs:mainfrom
igooch:webhook-annotation

Conversation

@igooch
Copy link
Copy Markdown
Contributor

@igooch igooch commented Apr 7, 2026

Modifies the ClaimStartupLatency metric to use a new agents.x-k8s.io/webhook-first-seen-at annotation for the start time, providing millisecond granularity. This replaces the use of the Kubernetes creation timestamp, which only has second precision, and resulted in inaccurate metrics.

Note that this metric is distinct from ControllerStartupLatency which only includes latency after the SandboxClaim has been seen by the agent-sandbox controller.

The actual webhook to add this annotation must be provided by the user or cloud provider. This PR only consumes the annotation.

Note for reviewer:

This PR is broken into two separate commits. The first commit has the functional changes. The second commit is refactoring only.

#245

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 7, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: igooch

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 7, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 7, 2026

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit ae8de2d
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/69d548f2852fc2000877e686

@igooch igooch marked this pull request as ready for review April 8, 2026 00:58
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 8, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@igooch: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
presubmit-agent-sandbox-lint-go ae8de2d link true /test presubmit-agent-sandbox-lint-go

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions 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. I understand the commands that are listed here.

@aditya-shantanu
Copy link
Copy Markdown
Contributor

@igooch -> Why does it have to be a webhook added timestamp ?
I can imagine that the client SDK is setting this instead ? (if the client so chooses ?)

  • my point being - let's rename the annotation to be a bit more generic ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants