You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(soak): the UNPINNED gate grades each reason for what it is, and fails a no-TLS state only when it stood (#1491) - #1494
Builds on #1490 (merged), which added the fourth reason, tls_not_published. The change is e2e/soak/** and one paragraph of docs/runbook.md.
What was wrong
e2e/soak/prober-grade.sh failed its UNPINNED gate when aether_agent_identity_cluster_unpinned_total moved for any reason, and its text said a TLS cluster was published without its server-identity pin. Since #1479 and #1490 the counter is split by reason, and under two of the four (trust_domain_unknown, tls_not_published) the agent publishes no TLS at all. Every agent start is in that state for a moment, and the soak rolls the agents on purpose (T0+72 and the TRIPLE at T0+300). So a soak with no validation gap could fail this gate, with a text that was untrue.
The verdict, per reason
reason (the line's class=)
What the agent did
The gate
no_namespace_metadata, pin_not_rendered (gap)
published TLS that checks no server identity
FAIL, exit 1, on any movement of the counter and on any non-zero sample of the published gauge. The text names reason, count and nodes.
trust_domain_unknown, tls_not_published (no_tls)
published no TLS for those entries
reported with reason, count and nodes; not a failure by itself. FAIL only when the state stood for 300 s or more (below). A standing tls_not_published that the operator declared expected (--expect-tls-not-published) is reported and does not fail.
any other value (unknown)
an agent newer than the script
FAIL on any movement of the counter and on any non-zero sample of the gauge; the text says the script does not know the reason and names the two lists to add it to.
FAIL on any movement, with the text the gate always had, plus the count and the nodes. Its one series holds every reason, so the old rule is the only safe one.
UNPROVEN (exit 2) still comes before FAIL (exit 1), in the verdict and in the exit status.
"Persisted too long": decided from what Prometheus can show
The counter cannot make this call. It adds the number of unpinned entries on every snapshot, so its size is entries times snapshots: ninety entries on two snapshots is 180, and so are two entries on ninety. Nothing in it is a duration, so a threshold on the count would be a guess about the size of the mesh.
The agent's gauge aether_agent_snapshot_tls_clusters{pin="unpinned",reason} (#1425) is the state itself, exported every minute with zeros included. Consecutive non-zero samples are a state that stood, from the first sample to the last. The gate reads the gauge's raw samples (one more instant query, seven in all) and fails a no_tls reason when a run spans 300 s or more, anywhere in the window. That covers the case the issue asks about (it never recovered: the run reaches the window's end) and also a state that stood for an hour in the middle and then cleared.
300 s is the for: 5m of AetherMeshClusterPinPending in docs/observability/agent-pin-alerts.yml, for the reasons given there: an agent without its SVID after 2 minutes reports NotReady, plus two export intervals, plus one for jitter.
A run is a lower bound. A state shorter than one export interval may be in no sample, which is why the counter stays the measure of whether it happened and the gauge only of how long.
A run is not carried across more than 300 s without a sample (Prometheus's own lookback).
A state still non-zero at the window's end for less than 300 s is an agent start the window cut. It is said on its line and not graded.
The gap reasons use the gauge too: a gap that stands through a window in which no snapshot is set does not move the counter, and the gauge shows it.
A run is the node's, not the pod's. Runs are computed per node, job and reason over every series of them, as the alert rule's sum by (job, node, reason) is. Where the collector keeps a per-pod label, a state that passes from an agent to its replacement is one run (series=2 on the line). A zero ends a run unless another series of the group has non-zero samples on both sides of it (two agents side by side in a surge roll).
The state at the window's start is asked for. Since Prometheus 3.0 a range selector is left-open, so gauge[28800s] at the window's end does not return a sample exactly at T0 (before 3.0 it did), and no version returns one from before it. A state already standing at T0 was read one sample short, and 300 s passed as 240. The query now reaches 120 s (two export intervals) and one second before the window ([28921s]; the second so that a sample exactly 120 s old is returned by a left-open range too); the last sample at or before T0 that is at most 120 s old is counted as the sample at T0 and anything older is dropped. A run starts at T0 at the earliest, on either version.
tls_not_published can be the cluster's design: --expect-tls-not-published
A mesh run without SPIRE never leaves that state, and a healthy agent keeps a TCP floor entry in it for as long as the floor is not published. The default stays strict: a standing tls_not_published fails. With --expect-tls-not-published the operator declares it expected on this cluster. The output then starts with an EXPECT line, and a tls_not_published state that stood is UNPINNED expected: node=… job=… reason=tls_not_published seconds=N published=N count=N, named in the verdict's text as expected by declaration, and not a failure. trust_domain_unknown is timed whatever the switch, and the gap reasons fail as before.
What the switch gives up: the metric does not tell an unpublished floor from an agent that cannot get its SVID (both are tls_not_published). With the switch, an agent stuck without its identity is not failed by this gate; it reports NotReady after two minutes. Splitting the reason would remove that, and is an agent change that is not made here.
An absent gauge is not a zero. The gauge arrived in the same agent as the reason label. An exporter whose counter has the label and whose gauge has no sample in the window is UNPINNED published: absent: node=… job=… [pod=…] and the gate is UNPROVEN, as #1484 treats a node whose counter was not seen. An exporter is every label of its counter series but reason, and a gauge series is its own when the two agree on every label both carry (each exporter on its own labels: a job without a per-pod label does not change the key of one that has it). With a per-pod label, then, a replaced agent that exports its seeded counter and never sets a snapshot is not covered by the gauge of the pod before it. Where restarts fall into one series, the gauge must have a sample since the counter was born or last reset (… no sample from it since its counter started again at <time>). A counter that rests at zero across a restart shows no reset, so that one case is not caught. Agents with no reason label have no gauge to miss: UNPINNED published: not graded: nodes=…, a statement and not a verdict.
Output: added, nothing renamed
UNPINNED reason=… count=N nodes=… gains a trailing class=gap|no_tls|unknown|unlabelled.
New UNPINNED steps: node=… job=… reason=… at=<time>(+N),…: the first six samples that showed an increase, to hold against the agent rolls in churn.log.
New UNPINNED published: node=… job=… reason=… class=… nonzero_samples=N longest=Ns max=N at_end=N series=N, and its two coverage forms absent: and not graded:.
New QUERY unpinned/published … line.
Only with --expect-tls-not-published: an EXPECT line, and UNPINNED expected: … for a state that stood.
The UNPINNED verdict=… increase=… series=… nodes=… resets=… fields are unchanged; only the text in parentheses differs by case.
e2e/soak/README.md ("Grading") has the table and the reasoning, the runbook's unpinned-signal section has a paragraph on the soak gate, and the script header describes the lines and the verdict.
Evidence
Fixtures are canned Prometheus responses. The eight existing scenarios each gained the gauge's response; the new cases are clean with one thing changed, built in the test. A fixture holds the samples the store has, and the harness's fake answers a range query from them as a server does (left-open; closed at both ends with FAKE_PROM_CLOSED_LEFT=1), so a fixture cannot hand over a sample that no server returns. grade-never used to: it has a sample exactly at T0.
Red, then green: the harness's grade section run against the script as it was on this branch's base, then against the new one.
Case
Unchanged script
This change
gap on the counter (two reasons), beside an agent start
FAIL with the old text: no reason, count or node; 180 of the 187 were not a gap
FAIL, exit 1, names both reasons with counts and nodes
gap in the gauge only, counter flat
PASS, exit 0
FAIL, exit 1
two agent starts, nothing else
FAIL, exit 1
PASS, exit 0, both reasons reported
the same, non-zero in the last gauge sample
FAIL, exit 1
PASS, and the line says the window ends on it
no TLS for 300 s (six samples)
FAIL as "published without its pin"
FAIL with the no-TLS text
240 s (five samples)
FAIL
PASS, longest=240s
two 240 s runs around a 10-minute gap
FAIL
PASS, two runs
never recovered, counter flat
PASS, exit 0
FAIL, longest=28800s at_end=2
unknown reason, moved / at rest
FAIL with the old text / PASS
FAIL saying the script does not know it / PASS
unknown reason in the gauge only
PASS, exit 0
FAIL, exit 1
no reason label, moved
FAIL with the old text (this rule is kept)
the same text, then the count and the node
reason label, no gauge
PASS, exit 0
UNPROVEN, exit 2
the same and a gap moved
FAIL, exit 1
UNPROVEN, exit 2
reset (existing): an agent rolled in the window, 2 under trust_domain_unknown
FAIL
PASS, reported
46 of the section's assertions fail against the unchanged script; all 148 pass against the new one.
The review round (four findings; the grade section run against the script as it was before that commit, then after):
Case
Before the review commit
Now
no TLS at T0-60, T0, … T0+300 (300 s in the window), served left-open
PASS, exit 0, nonzero_samples=5 longest=240s
FAIL, exit 1, nonzero_samples=6 longest=300s
the same, served closed at both ends (before 3.0)
not run against the old script
FAIL, exit 1, the same line
samples at T0-30, T0+30 … T0+270
longest=240s
PASS, longest=270s (from T0, not from the sample before it)
a state that was over before T0
(guard)
PASS, no published: line
grade-never, served left-open
FAIL with nonzero_samples=480 longest=28740s
FAIL with 481 and 28800 s
the old pod holds no TLS for 120 s, its replacement for 120 s more, one minute apart
PASS, exit 0, longest=120s
FAIL, exit 1, longest=300s series=2
the same with a zero first sample from the new pod
(guard) PASS
PASS, two runs of 120 s
a pod at zero beside one that holds the state for 300 s
(guard) FAIL
FAIL, 300 s
a replaced agent with a counter and no gauge; the old pod's gauge is in the range
PASS, exit 0
UNPROVEN, exit 2, names the new pod
no per-pod label, the counter reset, no gauge sample since
PASS, exit 0
UNPROVEN, exit 2, since its counter started again at …
the same with gauge samples after the reset
(guard) PASS
PASS
--expect-tls-not-published, tls_not_published standing for the whole window
the switch, and trust_domain_unknown standing 300 s
exit 2
FAIL, exit 1
the switch, and a gap beside the declared state
exit 2
FAIL, exit 1, about the gap
37 of the section's assertions fail against the script as it was before the review commit (eight of them only for the new series= field, the wider range in the QUERY line and the pod in the absent: line); all 186 pass now. A second round found that one exporter without a per-pod label took pod out of every exporter's key; its fixture (a node with no pod label beside a replaced pod whose predecessor ran on for two minutes) was PASS, exit 0 before that fix and is UNPROVEN, exit 2 now. A third round found that a sample exactly 120 s before T0 was not returned by the left-open range of the window plus 120 s; its fixture (samples at T0-120 and T0+60 … T0+300) was PASS with longest=240s before that fix and is FAIL with 300 s now. 193 assertions pass.
Against a real server. The pinned Prometheus (3.15.0, the archive //bazel/promtool comes from) was started on a developer machine with the fixture's samples loaded by promtool tsdb create-blocks-from openmetrics, and both scripts were run against its HTTP API with the real curl. For samples at T0-60, T0, T0+60 … T0+300, [28800s] at the window's end returned the five from T0+60 and [28920s] all seven; the unchanged script read longest=240s, PASS, and the new one longest=300s, FAIL. For grade-never the unchanged script read 480 samples and 28740 s, the new one 481 and 28800 s, and exit 0 with the switch. That is what the fake returns for the same samples.
Mutation checks, each applied to a copy of the script outside the tree and each caught by at least two assertions: a gap reason on the counter does not fail; an unknown reason does not fail; an unlabelled series does not fail; a gap in the gauge alone does not fail; a standing no-TLS state does not fail; the no-TLS reasons are not known as such; the bound is 240 s; the bound is 360 s; a run spans any gap in the samples; an absent gauge is not UNPROVEN; an unknown reason is classed no_tls; a gauge is demanded of unlabelled agents; a gap reason is classed no_tls; a gauge-only failure is for gap reasons only. For the review round, each caught by at least one assertion: the range is the window only; the state at T0 is not used; a run starts at the sample before T0; runs are per series; a zero from a pod beside ends a run; coverage is by node and job; the gauge is not required since the counter's restart; the switch is ignored; the switch is always on; the switch covers trust_domain_unknown too; a declared state fails anyway. The first one of the earlier list survived my first fixture (its gauge was non-zero too, so the gauge rule covered for the counter rule); the gap fixture is now counter-only, with the gauge variant as its own step.
bazel test //e2e/soak:all: passes (harness_test, 59 s).
A Prometheus before 3.0 was not run. That its range was closed at both ends is from its documentation; the fake's closed mode gives the same grade.
Which labels a real collector puts on the two metrics. A gauge series is matched to a counter on the labels both carry, so a label that only one of them has does not split them, but I have not seen the two side by side on a real store.
What the next soak should print, if the agents carry the label and the gauge: UNPINNED reason=trust_domain_unknown|tls_not_published … class=no_tls for each node whose agent was rolled, UNPINNED steps: times within a minute or two after the two agent rolls, no UNPINNED published: line or ones with longest under 300 s, and UNPINNED verdict=PASS. Against agents with no reason label it prints what it printed before: reason=- … class=unlabelled and verdict=FAIL on any movement.
Whether an edge control plane always sets a snapshot when it starts. The counter is seeded at process start and the gauge is first written with the first snapshot; a process that never set one would read published: absent and make the gate UNPROVEN. The README says so.
The comparison of UNPINNED steps: with the agent rolls in churn.log is left to the reader; the script prints the times and does not make it.
--expect-tls-not-published was not used on a cluster that needs it.
Updates the soak grader to distinguish TLS validation gaps from expected no-TLS startup states, while incorporating the stacked SAN-pin telemetry changes.
Changes:
Grades unpinned metrics by reason and duration.
Adds tls_not_published, seeded xDS counters, and alert rules.
Expands fixtures, tests, and operational documentation.
File
Description
e2e/soak/prober-grade.sh
Implements reason-aware grading and gauge-duration checks.
e2e/soak/README.md
Documents the revised grading contract.
docs/runbook.md
Expands SAN-pin operational guidance.
docs/observability/README.md
Documents SAN-pin metrics and alerts.
docs/observability/agent-pin-alerts.yml
Adds SAN-pin alert rules.
docs/observability/agent-pin-alerts_test.yml
Adds promtool rule tests.
agent/internal/xds/cache/cache.go
Documents the new unpinned cause.
agent/internal/xds/cache/mtls.go
Classifies entries where TLS is not publishable.
agent/internal/xds/cache/pinreport.go
Reconciles reported causes with published clusters.
agent/internal/xds/cache/snapshot.go
Applies cause reconciliation during snapshot generation.
prober-grade.sh failed its UNPINNED gate on any movement of
aether_agent_identity_cluster_unpinned_total, with a text saying a TLS
cluster was published without its server-identity pin. Two of the four
reasons (trust_domain_unknown, tls_not_published) are states in which the
agent publishes no TLS at all: every agent start, and a soak rolls the
agents twice.
The verdict is now per reason:
- no_namespace_metadata, pin_not_rendered: FAIL on any movement of the
counter or any non-zero sample of the published gauge; the text names
reason, count and nodes.
- trust_domain_unknown, tls_not_published: reported, not a failure by
itself. FAIL only when the gauge aether_agent_snapshot_tls_clusters
shows the state for 300 s or more of consecutive samples.
- a reason the script does not know: FAIL, and the text says so.
- a series with no reason label (an agent before #1424): any movement
fails, with the old text.
An agent that has the reason label and no gauge sample in the window is
UNPROVEN: an absent gauge is not a zero.
One more query (the gauge over the window). New lines: UNPINNED steps:,
UNPINNED published:; the UNPINNED reason= line gains class=.
Closes#1491
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
… per node over every pod, covers each exporter by its own gauge, and takes a declared tls_not_published (#1491)
Review of #1494, four findings on e2e/soak/prober-grade.sh.
The state at the window's start. A range selector is left-open since
Prometheus 3.0, so `gauge[<window>s]` at the window's end does not return a
sample exactly at T0, and no version returns one from before it: a no-TLS
state already standing at T0 was read one sample short, and 300 s passed as
240. The range now reaches FRESH_S (120 s) before the window, and the last
sample at or before T0 is the sample at T0. Checked against the pinned
Prometheus 3.15.0 with samples loaded by promtool.
Runs per node, job and reason, over every series of them, as the alert rule's
`sum by` is: a state that outlives the pod that first showed it is one run.
Gauge coverage per exporter (the labels the counter and the gauge share, less
reason and pin): a replaced agent that exports its seeded counter and never
sets a snapshot is not covered by the gauge of the pod before it. Without a
per-pod label, the gauge must have a sample since the counter's last restart.
--expect-tls-not-published: off by default, a standing tls_not_published
fails as before. With it the operator declares the state expected on this
cluster (no SPIRE, or unpublished TCP floors); it is reported with its
seconds, entries and count, and does not fail. trust_domain_unknown is timed
whatever the switch.
The fake Prometheus of the harness now answers a range query as a server
does (left-open; closed with FAKE_PROM_CLOSED_LEFT=1) from the samples a
fixture holds, so a fixture cannot hand over a sample no server returns.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…porter's own labels (#1491)
Review of #1494, second round. The exporter key was the labels common to
every counter and gauge series of the answer, so one job without a per-pod
label took `pod` out of the key of every other, and an old pod's gauge
sample after its replacement's counter was born covered a replacement that
never published a gauge: PASS where the gate documents UNPROVEN.
An exporter is now every label of its counter series but `reason`, and a
gauge series is its own when the two agree on every label both carry.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Include exact-boundary pre-window sample at FRESH_S
e2e/soak/prober-grade.sh:520
The widened range still drops a sample exactly FRESH_S (120 s) before T0 on Prometheus 3+, because the selector is left-open. Elsewhere FRESH_S treats only samples older than 120 s as ended, so an active state whose last pre-window sample is exactly T0−120 can be reconstructed starting at T0+60; six in-window samples through T0+300 are then measured as 240 s and incorrectly pass the 300 s gate. Query slightly farther back and explicitly clamp the chosen pre-window sample to >= T0-FRESH_S, or use an instant gauge query at T0; add the exact-boundary fixture.
…s still the state at the start (#1491)
Review of #1494, third round. The gauge's range reached exactly FRESH_S
(120 s) before the window, and a left-open range (Prometheus 3.0 and later)
does not return a sample exactly at its start: a state whose last sample
before T0 was exactly 120 s old was read from its first sample inside the
window. The range reaches one second further, and the sample taken for the
state at T0 is the last one at or before T0 that is at most FRESH_S old.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
On the finding in the last review summary (a sample exactly FRESH_S before T0): right, and fixed in 6518400. The range reaches one second further ([28921s]) and the sample taken for the state at T0 is the last one at or before T0 that is at most 120 s old. The exact-boundary fixture (samples at T0-120 and T0+60 … T0+300) was PASS with longest=240s on the previous commit and is FAIL with 300 s now; a sample 121 s old is not taken, even from a server that returns it.
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
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.
Closes #1491
Builds on #1490 (merged), which added the fourth reason,
tls_not_published. The change ise2e/soak/**and one paragraph ofdocs/runbook.md.What was wrong
e2e/soak/prober-grade.shfailed itsUNPINNEDgate whenaether_agent_identity_cluster_unpinned_totalmoved for any reason, and its text saida TLS cluster was published without its server-identity pin. Since #1479 and #1490 the counter is split byreason, and under two of the four (trust_domain_unknown,tls_not_published) the agent publishes no TLS at all. Every agent start is in that state for a moment, and the soak rolls the agents on purpose (T0+72 and the TRIPLE at T0+300). So a soak with no validation gap could fail this gate, with a text that was untrue.The verdict, per reason
reason(the line'sclass=)no_namespace_metadata,pin_not_rendered(gap)trust_domain_unknown,tls_not_published(no_tls)tls_not_publishedthat the operator declared expected (--expect-tls-not-published) is reported and does not fail.unknown)reasonlabel (unlabelled)UNPROVEN(exit 2) still comes beforeFAIL(exit 1), in the verdict and in the exit status."Persisted too long": decided from what Prometheus can show
The counter cannot make this call. It adds the number of unpinned entries on every snapshot, so its size is entries times snapshots: ninety entries on two snapshots is 180, and so are two entries on ninety. Nothing in it is a duration, so a threshold on the count would be a guess about the size of the mesh.
The agent's gauge
aether_agent_snapshot_tls_clusters{pin="unpinned",reason}(#1425) is the state itself, exported every minute with zeros included. Consecutive non-zero samples are a state that stood, from the first sample to the last. The gate reads the gauge's raw samples (one more instant query, seven in all) and fails ano_tlsreason when a run spans 300 s or more, anywhere in the window. That covers the case the issue asks about (it never recovered: the run reaches the window's end) and also a state that stood for an hour in the middle and then cleared.for: 5mofAetherMeshClusterPinPendingindocs/observability/agent-pin-alerts.yml, for the reasons given there: an agent without its SVID after 2 minutes reports NotReady, plus two export intervals, plus one for jitter.sum by (job, node, reason)is. Where the collector keeps a per-pod label, a state that passes from an agent to its replacement is one run (series=2on the line). A zero ends a run unless another series of the group has non-zero samples on both sides of it (two agents side by side in a surge roll).gauge[28800s]at the window's end does not return a sample exactly at T0 (before 3.0 it did), and no version returns one from before it. A state already standing at T0 was read one sample short, and 300 s passed as 240. The query now reaches 120 s (two export intervals) and one second before the window ([28921s]; the second so that a sample exactly 120 s old is returned by a left-open range too); the last sample at or before T0 that is at most 120 s old is counted as the sample at T0 and anything older is dropped. A run starts at T0 at the earliest, on either version.tls_not_publishedcan be the cluster's design:--expect-tls-not-publishedA mesh run without SPIRE never leaves that state, and a healthy agent keeps a TCP floor entry in it for as long as the floor is not published. The default stays strict: a standing
tls_not_publishedfails. With--expect-tls-not-publishedthe operator declares it expected on this cluster. The output then starts with anEXPECTline, and atls_not_publishedstate that stood isUNPINNED expected: node=… job=… reason=tls_not_published seconds=N published=N count=N, named in the verdict's text as expected by declaration, and not a failure.trust_domain_unknownis timed whatever the switch, and the gap reasons fail as before.What the switch gives up: the metric does not tell an unpublished floor from an agent that cannot get its SVID (both are
tls_not_published). With the switch, an agent stuck without its identity is not failed by this gate; it reports NotReady after two minutes. Splitting the reason would remove that, and is an agent change that is not made here.An absent gauge is not a zero. The gauge arrived in the same agent as the
reasonlabel. An exporter whose counter has the label and whose gauge has no sample in the window isUNPINNED published: absent: node=… job=… [pod=…]and the gate isUNPROVEN, as #1484 treats a node whose counter was not seen. An exporter is every label of its counter series butreason, and a gauge series is its own when the two agree on every label both carry (each exporter on its own labels: a job without a per-pod label does not change the key of one that has it). With a per-pod label, then, a replaced agent that exports its seeded counter and never sets a snapshot is not covered by the gauge of the pod before it. Where restarts fall into one series, the gauge must have a sample since the counter was born or last reset (… no sample from it since its counter started again at <time>). A counter that rests at zero across a restart shows no reset, so that one case is not caught. Agents with noreasonlabel have no gauge to miss:UNPINNED published: not graded: nodes=…, a statement and not a verdict.Output: added, nothing renamed
UNPINNED reason=… count=N nodes=…gains a trailingclass=gap|no_tls|unknown|unlabelled.UNPINNED steps: node=… job=… reason=… at=<time>(+N),…: the first six samples that showed an increase, to hold against the agent rolls inchurn.log.UNPINNED published: node=… job=… reason=… class=… nonzero_samples=N longest=Ns max=N at_end=N series=N, and its two coverage formsabsent:andnot graded:.QUERY unpinned/published …line.--expect-tls-not-published: anEXPECTline, andUNPINNED expected: …for a state that stood.UNPINNED verdict=… increase=… series=… nodes=… resets=…fields are unchanged; only the text in parentheses differs by case.e2e/soak/README.md("Grading") has the table and the reasoning, the runbook's unpinned-signal section has a paragraph on the soak gate, and the script header describes the lines and the verdict.Evidence
Fixtures are canned Prometheus responses. The eight existing scenarios each gained the gauge's response; the new cases are
cleanwith one thing changed, built in the test. A fixture holds the samples the store has, and the harness's fake answers a range query from them as a server does (left-open; closed at both ends withFAKE_PROM_CLOSED_LEFT=1), so a fixture cannot hand over a sample that no server returns.grade-neverused to: it has a sample exactly at T0.Red, then green: the harness's grade section run against the script as it was on this branch's base, then against the new one.
longest=240slongest=28800s at_end=2reset(existing): an agent rolled in the window, 2 undertrust_domain_unknown46 of the section's assertions fail against the unchanged script; all 148 pass against the new one.
The review round (four findings; the grade section run against the script as it was before that commit, then after):
nonzero_samples=5 longest=240snonzero_samples=6 longest=300slongest=240slongest=270s(from T0, not from the sample before it)published:linegrade-never, served left-opennonzero_samples=480 longest=28740slongest=120slongest=300s series=2since its counter started again at …--expect-tls-not-published,tls_not_publishedstanding for the whole windowunknown argumentEXPECTandUNPINNED expected: … seconds=28800 published=2 count=12trust_domain_unknownstanding 300 s37 of the section's assertions fail against the script as it was before the review commit (eight of them only for the new
series=field, the wider range in theQUERYline and the pod in theabsent:line); all 186 pass now. A second round found that one exporter without a per-pod label tookpodout of every exporter's key; its fixture (a node with nopodlabel beside a replaced pod whose predecessor ran on for two minutes) was PASS, exit 0 before that fix and is UNPROVEN, exit 2 now. A third round found that a sample exactly 120 s before T0 was not returned by the left-open range of the window plus 120 s; its fixture (samples at T0-120 and T0+60 … T0+300) was PASS withlongest=240sbefore that fix and is FAIL with 300 s now. 193 assertions pass.Against a real server. The pinned Prometheus (3.15.0, the archive
//bazel/promtoolcomes from) was started on a developer machine with the fixture's samples loaded bypromtool tsdb create-blocks-from openmetrics, and both scripts were run against its HTTP API with the realcurl. For samples at T0-60, T0, T0+60 … T0+300,[28800s]at the window's end returned the five from T0+60 and[28920s]all seven; the unchanged script readlongest=240s, PASS, and the new onelongest=300s, FAIL. Forgrade-neverthe unchanged script read 480 samples and 28740 s, the new one 481 and 28800 s, and exit 0 with the switch. That is what the fake returns for the same samples.Mutation checks, each applied to a copy of the script outside the tree and each caught by at least two assertions: a gap reason on the counter does not fail; an unknown reason does not fail; an unlabelled series does not fail; a gap in the gauge alone does not fail; a standing no-TLS state does not fail; the no-TLS reasons are not known as such; the bound is 240 s; the bound is 360 s; a run spans any gap in the samples; an absent gauge is not UNPROVEN; an unknown reason is classed
no_tls; a gauge is demanded of unlabelled agents; a gap reason is classedno_tls; a gauge-only failure is for gap reasons only. For the review round, each caught by at least one assertion: the range is the window only; the state at T0 is not used; a run starts at the sample before T0; runs are per series; a zero from a pod beside ends a run; coverage is by node and job; the gauge is not required since the counter's restart; the switch is ignored; the switch is always on; the switch coverstrust_domain_unknowntoo; a declared state fails anyway. The first one of the earlier list survived my first fixture (its gauge was non-zero too, so the gauge rule covered for the counter rule); the gap fixture is now counter-only, with the gauge variant as its own step.bazel test //e2e/soak:all: passes (harness_test, 59 s).bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //e2e/...: clean.make format-check,scripts/check-shell-lint.sh: clean.Not verified
reasonlabel or its gauge: the real server above held the fixtures' samples. The gauge's stored name and itspinandreasonlabels are taken from the agent's code and from the alert rules of fix(agent,observability): the NACK counters are seeded, a cluster with no TLS published is not reported as the validation gap, and alert rules ship for the SAN-pin state (#1480, #1482, #1481) #1490, not read back.UNPINNED reason=trust_domain_unknown|tls_not_published … class=no_tlsfor each node whose agent was rolled,UNPINNED steps:times within a minute or two after the two agent rolls, noUNPINNED published:line or ones withlongestunder 300 s, andUNPINNED verdict=PASS. Against agents with noreasonlabel it prints what it printed before:reason=- … class=unlabelledandverdict=FAILon any movement.published: absentand make the gateUNPROVEN. The README says so.UNPINNED steps:with the agent rolls inchurn.logis left to the reader; the script prints the times and does not make it.--expect-tls-not-publishedwas not used on a cluster that needs it.An agent wrote this pull request.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr