Skip to content

fix(prober): metrics carry the real node and the pod, and every failed probe logs one bounded AETHER_PROBE_FAIL line (#1041, #1040) - #1042

Merged
bpalermo merged 3 commits into
mainfrom
fix/1041-prober-labels-and-failure-log
Sep 28, 2026
Merged

bpalermo merged 3 commits into
mainfrom
fix/1041-prober-labels-and-failure-log

Conversation

@bpalermo

@bpalermo bpalermo commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Mechanism (#1041)

aether_probe_requests_total{node="prober-h2mzs"}: the prober's node label was its pod name. The chart's OTEL_RESOURCE_ATTRIBUTES (k8s.node.name=$(NODE_NAME),…,k8s.pod.name=$(POD_NAME)) was already correct. Two other things combined to overwrite it:

  1. newMeter built the resource with resource.WithHost(). The prober pod does not use hostNetwork, so host.name is the pod name.
  2. The talos collector's transform/promote set node from host.name first. It let k8s.node.name override that only for aether.cluster agent_xds/otel_collector, and its later backstop only fills an unset node.

This PR removes WithHost() from the prober. With no host.name, the collector's existing backstop already promotes k8s.node.name, so this PR on its own gives the prober the real node. The GitOps side, which fixes the precedence for every sender, is https://github.com/bpalermo/k8s-talos-main/pull/128.

New pod datapoint attribute on both instruments, taken from the resource's k8s.pod.name. Once node is the node, pod is what keeps per-pod anomalies apart, and it stops two prober generations on the same node from writing one series. The prober never stamps node itself.

#1040 logging half: AETHER_PROBE_FAIL

Every probe that does not succeed prints one line to stdout. It mirrors the soak's k6 AETHER_FAIL (e2e/soak/k6-mesh-soak.js): a fixed marker, then one JSON object.

AETHER_PROBE_FAIL {"t":"…","tier":"mesh_dns","target":"echo.aether-test.aether.internal:18081","result":"timeout","err":"Get \"…\": context deadline exceeded","elapsed_ms":2000.4,"pod":"prober-h2mzs","node":"main-worker-01","n":1,"truncated":false}
  • elapsed_ms is per failure, at 0.1 ms resolution. A 2 s timeout is distinguishable from a fast connection_error.
  • err is the Go error string. For http_error it is HTTP <status>. For saturated it is "max in-flight probes reached; probe not sent".
  • Cap: at most 20 detail lines per (tier, result) per minute. n counts them and truncated:true marks the 20th. After the cap, failures are only counted. When the window closes, ONE summary line with the same marker carries {"suppressed":N,"window_s":60,…}. A one-minute ticker in Run and a final flush on shutdown emit it, so the tail of a burst is not lost. The prober: one pod recorded ~142 mesh_dns 2 s timeouts (30 s) during the rev246 proxy hot-restart roll while the proxy-side view was flat — unattributable today #1040 burst of about 142 timeouts in 30 s would print 20 lines plus 1 summary.
  • Design choice: the cap is per window, not for the lifetime of the process. A lifetime cap of 20 would be used up by ordinary roll noise within days, and the next burst would again be unattributable. The per-window budget still guarantees that a burst cannot flood the log pipeline. The worst case is 20 × (number of result classes) lines per minute per tier.
  • Output goes to stdout as a single Write under a mutex. It does not go through slog, so the line is exactly marker + JSON, the same shape as k6.

Gates, seen red

New file prober/internal/prober/identity_test.go:

  • TestResourceIdentity: with the chart's env, the resource carries k8s.node.name and k8s.pod.name, and has no host.name.
  • TestDatapointsCarryPod: the exported counter and histogram datapoints (ManualReader) carry tier/target/result/pod, and no node.
  • TestProbeFailureLine: drives 27 real probe() calls against a refused port. It expects exactly 20 lines with the correct fields (the err contains "refused", elapsed_ms < 1000, n/truncated), then one summary with suppressed:7 when the window closes, then a fresh budget in the next window.
  • TestProbeFailureLineTimeout: a server that hangs, with a 150 ms budget, gives result:timeout and elapsed_ms >= 150.
  • TestFailLogCapIsPerKey: a flood of one class does not silence another, and nothing is flushed while the window is still open.

Red evidence:

  • Against origin/main's prober.go: the package fails to compile (undefined: newResource / newProber / failLinePrefix / failLogCap). Today's code has no seam for any of this.
  • Mutation run: I put resource.WithHost() back, dropped the pod attribute, and dropped the fails.log call, all on this branch. Result: TestResourceIdentity fails with resource carries host.name="palermo-desktop". TestDatapointsCarryPod fails with pod = "" (present=false), want "prober-h2mzs" on both instruments. TestProbeFailureLine fails with a burst of 27 failures printed 0 lines, want exactly the cap 20. TestProbeFailureLineTimeout fails with got 0 lines, want 1. With the mutations reverted, all pass.

Green:

  • bazel test //prober/... //charts/prober/...: 4/4 pass (prober_test, image_test, chart lint and template).
  • --config=race //prober/internal/... passes. //prober/... cannot be analysed under --config=race at all, because its image_index target rejects race with cgo off. That was already true on main and is not caused by this PR.
  • --config=lint --@aspect_rules_lint//lint:fail_on_violation //prober/... is clean. //:format produces no diff. Gazelle was run for the two new files.
  • No new external dependencies: faillog.go uses the standard library only, and the test deps are OTel modules the package already uses. The prober has no deps_test. The chart is unchanged, so charts/prober/Chart.yaml is not bumped.

Docs

  • docs/runbook.md: new section, "Attributing a prober failure: its labels and the AETHER_PROBE_FAIL line". It covers the label table (node, pod, tier, target, result); the fact that before prober: the metric 'node' label carries the pod name, not the Kubernetes node #1041 node was the pod name; by (node) vs by (node, pod) queries; the refactor: Extract shared manager bootstrap into common/manager #47 dead-generation guard, which must move to on (node, pod); the line format and cap; and the VictoriaLogs query _stream:{k8s.namespace.name="aether-test"} AND "k8s.container.name":prober AND "AETHER_PROBE_FAIL". The runbook had no existing prober-by-node query to rewrite.
  • docs/configuration.md: the prober metrics list pod; a note on why the prober sets no host.name; the failure log.
  • e2e/soak/README.md, Grading: node now means the node, a per-node query, and attributing bursts from AETHER_PROBE_FAIL.

Deploy and merge order

Deploy this first, then merge https://github.com/bpalermo/k8s-talos-main/pull/128. That order keeps prober generations on one node from ever sharing a series. Note that deploying this PR alone already changes the prober's node to the Kubernetes node, through the collector's existing backstop. Follow-up in k8s-talos-main, not included here, due with this deploy: the prober alert rules' and on (node) max by (node) (present_over_time(...)) guard (#47) and their "LABEL WARNING: node is the pod name" comment need to move to (node, pod). Without that change, a dead prober generation's frozen burst passes the guard whenever a new prober pod is present on the same node.

Closes #1041
Refs #1040. The burst itself stays open until the next occurrence is attributed with this line.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

bpalermo and others added 2 commits September 28, 2026 07:04
…d probe logs one bounded AETHER_PROBE_FAIL line (#1041, #1040)

The prober's resource carried host.name (resource.WithHost), which on a
non-hostNetwork pod is the POD name, and the talos collector promoted host.name
to the metric `node` label ahead of k8s.node.name: every prober series said
node="prober-xxxxx". The resource no longer carries host.name; node identity
comes only from k8s.node.name (chart env). The pod is now its own `pod`
datapoint attribute on both instruments, so per-pod anomalies stay
distinguishable once `node` is the node.

Every non-success probe prints one line to stdout,
AETHER_PROBE_FAIL {t, tier, target, result, err, elapsed_ms, pod, node, n, truncated},
mirroring the soak's k6 AETHER_FAIL. It is capped at 20 lines per
(tier, result) per minute; past the cap failures are counted and one summary
line per window carries the suppressed count. Run flushes the summaries on a
one-minute ticker and on shutdown.

Docs: runbook section on the prober's labels and the failure line (with the
VictoriaLogs query), configuration.md metrics, soak README grading.

Closes #1041
Refs #1040

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Comment thread prober/internal/prober/faillog.go Fixed
@bpalermo
bpalermo merged commit 26ed7bc into main Sep 28, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/1041-prober-labels-and-failure-log branch September 28, 2026 10:20
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.

prober: the metric 'node' label carries the pod name, not the Kubernetes node

2 participants