Skip to content

agent: udp_unsupported counter is never seeded, so it has no Prometheus series (#873/#874 observability half is inert) #882

Closed

Description

@bpalermo

Summary

aether.agent.l4route.udp_unsupported — the counter #874 added for #873 — is registered but never seeded at zero, so it does not exist in Prometheus at all. A grading query against it reads "no data", which is indistinguishable from "zero, and healthy".

This is the exact failure the seed block directly above it was written to prevent.

Evidence

agent/internal/xds/cache/cachemetrics/cachemetrics.go. The counter is registered at line 163:

if m.udpRouteUnsupported, err = meter.Int64Counter("aether.agent.l4route.udp_unsupported",
    metric.WithDescription("UDPRoute inputs discarded because the UDP capture listener cannot represent them (#873)")); err != nil {
    return nil, err
}

The seed block that follows it seeds four counters, and udpRouteUnsupported is not among them:

// Seed the two #638 discriminator counters, the #717 stale-netns counter and
// the #832 unpinned-cluster counter at zero. The OTel SDK exports a counter
// only after its first Add, so a counter that is never incremented (the
// healthy case for all four) never appears in Prometheus at all — and "no
// series" is indistinguishable from "zero" to a grading query. ...
ctx := context.Background()
m.bindingMismatch.Add(ctx, 0)
m.inboundBindingMismatch.Add(ctx, 0)
m.staleNetnsSkipped.Add(ctx, 0)
m.clusterUnpinned.Add(ctx, 0)

The comment still says "the healthy case for all four" — it was written for four counters, and the fifth was added to registration without being added to the list.

Confirmed on talos-main (helm rev 231, aether-0.93.2-bf2acf76…, the build currently under soak). Listing every aether_agent_(l4route|identity|snapshot)_* metric name in Prometheus returns:

aether_agent_identity_cluster_unpinned_total            <- seeded, present
aether_agent_identity_inbound_binding_mismatch_total    <- seeded, present
aether_agent_identity_outbound_binding_mismatch_total   <- seeded, present
aether_agent_snapshot_stale_netns_skipped_total         <- seeded, present
aether_agent_l4route_udp_unsupported_total              <- ABSENT

All four seeded siblings exist. The unseeded one does not, and no l4route metric is returned at all.

Why it matters

#873 was filed because the UDP capture listener silently discarded UDPRoute inputs. #874 fixed that with two signals: a WARN log and this counter. Only the log works. Anyone who builds a dashboard panel or an alert rule on the counter — the natural thing to do, and the reason it was added — gets a permanently empty series and concludes the path is healthy.

It is also invisible in exactly the condition where it matters least to be wrong and most likely to be trusted: a cluster with no UDPRoutes at all, where "no series" and "zero" genuinely coincide, so the gap will not be noticed until a real discard happens and still produces nothing.

Same class as #853 and #880: a control that is configured, looks correct, and cannot report.

Fix

Add m.udpRouteUnsupported.Add(ctx, 0) to the seed block, and correct the comment's "all four" and its enumeration of which issues the seeded counters belong to.

While there: the registration returns a bare err where every sibling wraps it (fmt.Errorf("stale netns skipped: %w", err) etc.), so a failure to register this one counter produces an unattributed error. Same edit, same cause.

Acceptance criterion

Not "the field is in the list" — that is unfalsifiable by inspection. The test should assert against the exported metric set: register the meter with a test exporter, collect without incrementing anything, and assert a data point exists for every counter the package registers. That form catches the next counter added without a seed, which is the actual recurring defect (this is the second time: the block's own comment records "Observed on talos-main rev200: neither #638 series existed").

To see it fail: remove any one Add(ctx, 0) and the test should name that counter.

Not affected

The data path. UnsupportedUDPRouteShapes and the WARN log are correct, and #873's behaviour is unchanged — this is purely the observability half.

Found while launching the 8h soak on rev231; the soak's UDP leg is being graded from the log line rather than the counter as a result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions