Skip to content

feat(stovepipe): report last-green freshness - #572

Closed
mnoah1 wants to merge 6 commits into
mainfrom
mnoah1/stovepipe-lastgreen-freshness
Closed

feat(stovepipe): report last-green freshness#572
mnoah1 wants to merge 6 commits into
mainfrom
mnoah1/stovepipe-lastgreen-freshness

Conversation

@mnoah1

@mnoah1 mnoah1 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Support periodic observations of queue health via a Reporter interface. This can be called as part of other tasks that we know will alter queue state (wired here into the record step), and also triggered separately on a periodic schedule.

SourceControl will provide one extra method to provide the timestamp of the latest green commit - this will give us a real time gauge of how much time has elapsed since the last commit was marked green.

Since this is a real time observation of current state, and not a collection of observations, a histogram does not make sense for this use case - updated docs to clarify when to use gauge vs. histogram.

Test Plan

  • Deploy with this change (and corresponding source control changes), add query for this change

Callers gate deployments on a queue's last-known-green commit, so its age is
the staleness of the newest thing they are allowed to ship. A queue whose green
bookmark stops advancing looks healthy from the pipeline's perspective —
nothing is failing — while the answer it serves silently ages, and today
nothing makes that visible.

Add an observability extension seam alongside the existing ones: a Reporter
bound to a single queue by its Factory, whose Report emits one sample of that
queue's current state. Reporting is best-effort by contract — Report returns
nothing, because an observation that cannot be made must never change what the
pipeline records or decides — so implementations emit their own error metrics
and callers can defer a report without handling a result.

The lastgreen implementation reports that age as a gauge, the first in the
repo: the answer is the latest observation rather than a distribution, which
the platform/metrics guidance now admits alongside a NamedGauge helper. Dating
the bookmarked commit needs a timestamp SourceControl did not expose, so
ChangeInfo joins that contract, returning immutable metadata about the commit a
URI names rather than about the ref that points at it. The record stage, which
owns the bookmark, reports after handling each message.
@mnoah1
mnoah1 force-pushed the mnoah1/stovepipe-lastgreen-freshness branch from b282822 to 029d68a Compare August 11, 2026 22:39
@mnoah1
mnoah1 marked this pull request as ready for review August 11, 2026 22:46
@mnoah1
mnoah1 requested review from a team, behinddwalls and sbalabanov as code owners August 11, 2026 22:46
Comment thread stovepipe/extension/observability/observability.go Outdated
mnoah1 and others added 3 commits August 12, 2026 15:41
The Reporter interface, its Factory, and the lastgreen implementation had one
implementation and one caller, and abstracted no technology choice: storage and
source control were already extensions, and tally arrives as an injected scope.
What remained was domain logic, which moves into the periodicmetrics controller.
Add a periodicmetrics queue stage that emits the age of a queue's
last-known-green commit as a gauge. It is the one stage no other stage feeds:
the deployment publishes a PeriodicMetrics message on a schedule, because the
health it reports degrades while the pipeline is idle and so cannot be observed
from pipeline activity alone.

A failed observation acks and is counted with the step that failed; only a
message violating the payload contract is rejected, so a persistently
unresolvable queue cannot fill the dead-letter queue at the publishing rate.

record no longer reports, which takes a source-control call off the delivery
path of the stage that owns durable validation state.
@mnoah1

mnoah1 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Closing - aligned on polling for this internally.

@mnoah1 mnoah1 closed this Aug 12, 2026
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