Skip to content

Export first-ready resource timestamps - #128

Draft
justinmir wants to merge 1 commit into
mainfrom
feat/first-ready-timestamp
Draft

justinmir wants to merge 1 commit into
mainfrom
feat/first-ready-timestamp

Conversation

@justinmir

Copy link
Copy Markdown
Contributor

Achilles exports current readiness but does not retain when a resource first became ready. Add achilles_resource_first_ready_timestamp_seconds, enabled by default for FSM resources and claims, and persist the timestamp in infrared.reddit.com/first-ready-at so it survives controller restarts and later readiness changes.

How it works

Both reconcilers share timestamp tracking based on persisted Ready=True conditions for the current generation. Metadata patches use optimistic locking, and the gauge is published only after persistence succeeds.

flowchart LR
    R[Persisted Ready condition] --> A[Store first-ready-at once]
    A --> M[Export timestamp gauge]
    S[Existing annotation after restart] --> M
Loading

Existing resources are seeded from their current Ready transition as a best-effort historical estimate. Stored timestamps remain stable while resources are unready, suspended, or terminating; deleted objects lose their metric series, and replacements start fresh. AchillesResourceFirstReady in the shared recorder's disable options disables both tracking and export. No CRD schema changes are required.

Validated with make generate, make test (race enabled), and make lint using Go 1.24.11. Regression coverage includes status and annotation write failures, conflicts, restart recovery, readiness changes, deletion, and recreation.

Persist the first observed Ready transition on SDK resources and claims, and export it as a timestamp gauge that survives controller restarts and readiness changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant