Skip to content

feat(agent): count healthy SVID and trust-bundle updates; seed the sweep counters (#799) - #806

Merged
bpalermo merged 1 commit into
mainfrom
feat/svid-update-counters
Sep 19, 2026
Merged

bpalermo merged 1 commit into
mainfrom
feat/svid-update-counters

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Item 2 of the post-soak ranking; part of #799.

The identity bridge only had failure instruments, and handleSVIDUpdate logged at
DEBUG, so a rotation — the most important thing the identity path does — left no
trace in the agent. The 2026-09-19 8-hour soak had to infer four rotation cycles
from Envoy's per-secret envoy_sds_*_version gauges, excluding every proxy-roll
bucket by hand because a new Envoy changes every gauge once.

  • aether.agent.spire.svid_updates{identity=pod|node, update=initial|rotated|unchanged}:
    pod updates are classified per network namespace against the chain last served
    (forgotten on unsubscribe, so a rolling restart never reads as a rotation;
    unchanged is what a re-subscribe after a stream failure redelivers); the node
    SVID counts only on change, because the refresher polls.
  • aether.agent.spire.bundle_updates{bundle=own|federated, update=initial|rotated}:
    own/rotated is a trust-root change.
  • INFO lines pod SVID rotated, node SVID rotated, Workload API trust bundle changed — each rare by construction.
  • Every attribute set is seeded at zero (fix(agent): seed the #638 identity mismatch counters at zero (false-zero in Prometheus) #717).

Also seeds the attribute-less ghost-sweep counters and
identity.spiffe_id_override_rejected at zero: two soaks running needed "no
series = no prunes" reasoning about orphans_pruned, with the previous agent
generation's value lingering through the staleness window after every roll.

Tests: the fixture now installs its instruments before Start — the refresher
records on the healthy path from its first pass, so installing them afterwards
raced it under -race. Two assertions that expected an absent series now expect
the seeded zero.

No chart change. bazel test //agent/internal/spire:all //agent/internal/cni/server:server_test green, and ×3 under --config=race.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…eep counters (#799)

The identity bridge only had failure instruments, and handleSVIDUpdate logged at
DEBUG, so a rotation — the most important thing the identity path does — left no
trace in the agent. The 2026-09-19 8-hour soak had to infer four rotation cycles
from Envoy's per-secret `envoy_sds_*_version` gauges, excluding every proxy-roll
bucket by hand because a new Envoy changes every gauge once.

- `aether.agent.spire.svid_updates{identity=pod|node, update=initial|rotated|unchanged}`:
  pod updates are classified per network namespace against the chain last served
  (forgotten on unsubscribe, so a rolling restart never reads as a rotation;
  `unchanged` is what a re-subscribe after a stream failure redelivers); the node
  SVID counts only on change, because the refresher polls.
- `aether.agent.spire.bundle_updates{bundle=own|federated, update=initial|rotated}`:
  `own/rotated` is a trust-root change.
- INFO lines `pod SVID rotated`, `node SVID rotated`, `Workload API trust bundle
  changed` — each rare by construction.
- Every attribute set is seeded at zero (#717).

Also seeds the attribute-less ghost-sweep counters and
`identity.spiffe_id_override_rejected` at zero: two soaks running needed "no
series = no prunes" reasoning about `orphans_pruned`, with the previous agent
generation's value lingering through the staleness window after every roll.

Tests: the fixture now installs its instruments before Start — the refresher
records on the healthy path from its first pass, so installing them afterwards
raced it under -race. Two assertions that expected an absent series now expect
the seeded zero.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 371a493 into main Sep 19, 2026
20 checks passed
@bpalermo
bpalermo deleted the feat/svid-update-counters branch September 19, 2026 12:26
bpalermo added a commit that referenced this pull request Sep 19, 2026
…I DEL, quiet leader-election shutdown, 036 outcome (#799) (#810)

- docs(runbook, soak README): `svid_updates{update="rotated"}` means the
  certificate changed, not that the TTL ran down. A restarted SPIRE agent re-mints
  every SVID on its node, so a spire-agent restart moves `rotated` by the node's
  pod count and leaves `unchanged` at zero (measured on rev219: 0 -> 7 pods, 0 -> 1
  node). The text added in #806 said otherwise. Rotation cadence has to exclude
  the minutes in which that node's spire-agent restarted.
- agent: RemovePod logs `pod removed: CNI DEL served` (pod, namespace, netns,
  containerID) at INFO. A successful DEL used to leave only two anonymous
  "setting snapshot" DEBUG lines, so "a late DEL cleaned this pod up" could not be
  told from "the ghost sweep pruned it" without reading snapshot timestamps.
- common/manager: controller-runtime's "error received after stop sequence was
  engaged" carrying "leader election lost" is demoted to INFO ("leader election
  released on shutdown"). Every leader-elected component logs it on a clean
  SIGTERM — the manager cancels the election context itself — and it was the last
  ERROR line on a healthy roll after #807. Exactly that record only: any other
  error after the stop sequence, and a lost lease outside shutdown, stay ERROR.
- docs(proposals/036): status and a second Outcome section — the 8-hour soak
  (4 rotation cycles, a signing-CA rotation, zero identity errors), phase 2 done,
  #804/#805, #806, #807, what is still open (phase 3, the selector gain).


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Fable 5.1 <[email protected]>
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.

1 participant