gw-11 — Verification

One command

cd gw-11-data-plane-observability && bash scripts/verify.sh

What the tests prove

TestInvariant
TestHistogramQuantilebucket-based percentiles are correct (p99 = fast bucket, p99.9 = slow tail)
TestPercentilesMergeNotAverageaveraging per-instance p99s is wrong; merging buckets then quantile-ing is right (51ms vs 100ms)
TestParseTraceparentvalid W3C traceparent parses; malformed/all-zero/short/bad-version are rejected
TestTracePropagationKeepsTracethe proxy child keeps the trace-id + sampling decision and mints a new span-id; inject/extract round-trips
TestExtractMissingIsNotOKan absent traceparent is not silently treated as valid
TestREDper-route rate, error ratio, p99, and retry ratio are computed correctly

All under -race.

Demo (obsdemo, in verify.sh)

  • avg-of-p99 (0.051s, WRONG) vs merged p99 (0.100s, RIGHT),
  • a traceparent forwarded with the same trace-id and a new span-id.

What "green" does NOT guarantee

  • Not a full pipeline. No OTel Collector / Prometheus backend; this is the in-process primitives. Wiring into gw-03 is an exercise (GUIDE §6.1).
  • No tail-based sampling / burn-rate alerts in the core package (exercises §6.2/§6.3).
  • HTTP status only. Reading gRPC status from trailers (gw-02) so a 200 + grpc-status 14 counts as an error is an exercise (§6.4).