Repository navigation
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
Conversation
…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
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
… make() capacity (CodeQL go/allocation-size-overflow) Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Mechanism (#1041)
aether_probe_requests_total{node="prober-h2mzs"}: the prober'snodelabel was its pod name. The chart'sOTEL_RESOURCE_ATTRIBUTES(k8s.node.name=$(NODE_NAME),…,k8s.pod.name=$(POD_NAME)) was already correct. Two other things combined to overwrite it:newMeterbuilt the resource withresource.WithHost(). The prober pod does not use hostNetwork, sohost.nameis the pod name.transform/promotesetnodefromhost.namefirst. It letk8s.node.nameoverride that only foraether.clusteragent_xds/otel_collector, and its later backstop only fills an unsetnode.This PR removes
WithHost()from the prober. With nohost.name, the collector's existing backstop already promotesk8s.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
poddatapoint attribute on both instruments, taken from the resource'sk8s.pod.name. Oncenodeis the node,podis what keeps per-pod anomalies apart, and it stops two prober generations on the same node from writing one series. The prober never stampsnodeitself.#1040 logging half:
AETHER_PROBE_FAILEvery 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.elapsed_msis per failure, at 0.1 ms resolution. A 2 stimeoutis distinguishable from a fastconnection_error.erris the Go error string. Forhttp_errorit isHTTP <status>. Forsaturatedit is "max in-flight probes reached; probe not sent".(tier, result)per minute.ncounts them andtruncated:truemarks 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 inRunand 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.Writeunder 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 carriesk8s.node.nameandk8s.pod.name, and has nohost.name.TestDatapointsCarryPod: the exported counter and histogram datapoints (ManualReader) carrytier/target/result/pod, and nonode.TestProbeFailureLine: drives 27 realprobe()calls against a refused port. It expects exactly 20 lines with the correct fields (theerrcontains "refused",elapsed_ms< 1000,n/truncated), then one summary withsuppressed:7when the window closes, then a fresh budget in the next window.TestProbeFailureLineTimeout: a server that hangs, with a 150 ms budget, givesresult:timeoutandelapsed_ms>= 150.TestFailLogCapIsPerKey: a flood of one class does not silence another, and nothing is flushed while the window is still open.Red evidence:
origin/main'sprober.go: the package fails to compile (undefined: newResource / newProber / failLinePrefix / failLogCap). Today's code has no seam for any of this.resource.WithHost()back, dropped thepodattribute, and dropped thefails.logcall, all on this branch. Result:TestResourceIdentityfails withresource carries host.name="palermo-desktop".TestDatapointsCarryPodfails withpod = "" (present=false), want "prober-h2mzs"on both instruments.TestProbeFailureLinefails witha burst of 27 failures printed 0 lines, want exactly the cap 20.TestProbeFailureLineTimeoutfails withgot 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=raceat all, because itsimage_indextarget 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.//:formatproduces no diff. Gazelle was run for the two new files.faillog.gouses the standard library only, and the test deps are OTel modules the package already uses. The prober has nodeps_test. The chart is unchanged, socharts/prober/Chart.yamlis not bumped.Docs
docs/runbook.md: new section, "Attributing a prober failure: its labels and theAETHER_PROBE_FAILline". 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 #1041nodewas the pod name;by (node)vsby (node, pod)queries; the refactor: Extract shared manager bootstrap into common/manager #47 dead-generation guard, which must move toon (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-nodequery to rewrite.docs/configuration.md: the prober metrics listpod; a note on why the prober sets nohost.name; the failure log.e2e/soak/README.md, Grading:nodenow means the node, a per-node query, and attributing bursts fromAETHER_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
nodeto 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