feat(stovepipe): report the last-green change timestamp from record - #583
Merged
Conversation
Advancing the last-green bookmark is invisible to operators today, so there is no way to see how old the commit a queue considers green is. Record now looks up the commit's immutable creation time and emits it as a Unix-seconds gauge, letting a dashboard subtract it from timestamp() to read the bookmark's age. Reporting is best-effort: an unresolvable queue, a failed lookup, and a missing timestamp are each counted and logged rather than returned, so an observability failure cannot retry a successful record operation. Adds SourceControl.ChangeInfo for the commit metadata and a NamedGauge helper. A gauge is reported once per update, so this series is sparse by construction and carries no value between advances -- alerting on a queue that stops going green belongs on last_green_advanced instead.
mnoah1
requested review from
a team,
behinddwalls and
sbalabanov
as code owners
August 12, 2026 21:54
…VCS terms The emit path's comments named a specific metrics query language and called the validated entity a commit, but source-control URIs are VCS-agnostic and the gauge is better explained by what it carries: a creation time in Unix seconds that a query subtracts from the current time to get an age. Renames the fake's synthetic spacing constant and the record test fixture to match. No behavior change.
behinddwalls
approved these changes
Aug 12, 2026
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.
Summary
record.last_green_timestamp_secondsgauge (Unix seconds, tagged by queue), written after the bookmark update is durable. Subtracting it from the current time gives how old the change a queue considers green is.SourceControl.ChangeInfo(ctx, uri)for immutable change metadata (CreatedAtas an int64 millisecond timestamp, matching the rest of the repo) plus the fake implementation, and ametrics.NamedGaugehelper.Caveat worth reviewing
A tally gauge is reported once per
Update, not continuously, so this series is sparse by construction: it has a datapoint only when the bookmark advances, and carries no value between advances or after a restart. Queries must aggregate across replicas withmax/last-value. That means it cannot alert on a queue that stops going green — the existingrecord.last_green_advancedcounter is the signal for that. Theplatform/metricsREADME now states this so the next caller ofNamedGaugesees it. If we want a continuously readable value, the follow-up is a periodic per-queue reporter overqueueconfig.Store.List+QueueStore.Get.Test plan
go build ./...go test ./stovepipe/... ./platform/metrics/...make gazelleproduces no BUILD changes;gofmt -lcleanrequired-checksgatemake mocksfails at HEAD independently of this branch — mockgen's source mode cannot parseHistory's genericpage.Page[string]return, sosourcecontrol_mock.gocannot be regenerated locally.