Skip to content

feat(stovepipe): report the last-green change timestamp from record - #583

Merged
mnoah1 merged 2 commits into
mainfrom
mnoah1/stovepipe-lastgreen-timestamp
Aug 12, 2026
Merged

feat(stovepipe): report the last-green change timestamp from record#583
mnoah1 merged 2 commits into
mainfrom
mnoah1/stovepipe-lastgreen-timestamp

Conversation

@mnoah1

@mnoah1 mnoah1 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Record now emits the creation time of the change the last-green bookmark points at as a record.last_green_timestamp_seconds gauge (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.
  • Adds SourceControl.ChangeInfo(ctx, uri) for immutable change metadata (CreatedAt as an int64 millisecond timestamp, matching the rest of the repo) plus the fake implementation, and a metrics.NamedGauge helper.
  • Reporting is best-effort: an unresolvable queue, a failed lookup, and a missing timestamp are each counted and logged separately rather than returned, so an observability failure cannot turn a successful record operation into a retry.

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 with max/last-value. That means it cannot alert on a queue that stops going green — the existing record.last_green_advanced counter is the signal for that. The platform/metrics README now states this so the next caller of NamedGauge sees it. If we want a continuously readable value, the follow-up is a periodic per-queue reporter over queueconfig.Store.List + QueueStore.Get.

Test plan

  • go build ./...
  • go test ./stovepipe/... ./platform/metrics/...
  • make gazelle produces no BUILD changes; gofmt -l clean
  • CI required-checks gate
  • Note: make mocks fails at HEAD independently of this branch — mockgen's source mode cannot parse History's generic page.Page[string] return, so sourcecontrol_mock.go cannot be regenerated locally.

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
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.
@mnoah1 mnoah1 changed the title feat(stovepipe): report the last-green commit timestamp from record feat(stovepipe): report the last-green change timestamp from record Aug 12, 2026
@mnoah1
mnoah1 added this pull request to the merge queue Aug 12, 2026
Merged via the queue into main with commit de75bef Aug 12, 2026
15 checks passed
@mnoah1
mnoah1 deployed to stack-rebase August 12, 2026 22:40 — with GitHub Actions Active
@behinddwalls
behinddwalls deleted the mnoah1/stovepipe-lastgreen-timestamp branch August 12, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants