feat: distinguish UPSTREAM vs FORWARD in logs and stats #103

Merged
razvandimescu merged 3 commits from feat/upstream-log-label into main 2026-04-15 19:00:28 +08:00
razvandimescu commented 2026-04-14 23:18:47 +08:00 (Migrated from github.com)

Summary

  • Queries matching a [[forwarding]] suffix rule keep logging as FORWARD; queries resolved via the default [upstream] pool now log as UPSTREAM. Previously both shared FORWARD, making it impossible to tell from logs whether a rule matched.
  • Adds QueryPath::Upstream, a queries.upstream counter in /stats, and matching dashboard filter / bar / tag.
  • Addresses item (3) in #102.

Test plan

  • cargo test --lib (285 pass, +1 new — pipeline_default_pool_reports_upstream_path)
  • cargo clippy --all-targets (no new warnings)
  • Smoke: start numa, query a domain that hits a [[forwarding]] rule and one that doesn't; confirm log labels differ.
  • /stats exposes queries.upstream alongside queries.forwarded.
  • Dashboard: Upstream row appears in the path chart; upstream filter works in Recent Queries.

Out of scope

Items (1), (2), (4) from #102 — tracked separately.

## Summary - Queries matching a `[[forwarding]]` suffix rule keep logging as `FORWARD`; queries resolved via the default `[upstream]` pool now log as `UPSTREAM`. Previously both shared `FORWARD`, making it impossible to tell from logs whether a rule matched. - Adds `QueryPath::Upstream`, a `queries.upstream` counter in `/stats`, and matching dashboard filter / bar / tag. - Addresses item (3) in #102. ## Test plan - [x] `cargo test --lib` (285 pass, +1 new — `pipeline_default_pool_reports_upstream_path`) - [x] `cargo clippy --all-targets` (no new warnings) - [x] Smoke: start numa, query a domain that hits a `[[forwarding]]` rule and one that doesn't; confirm log labels differ. - [x] `/stats` exposes `queries.upstream` alongside `queries.forwarded`. - [x] Dashboard: `Upstream` row appears in the path chart; `upstream` filter works in Recent Queries. ## Out of scope Items (1), (2), (4) from #102 — tracked separately.
Sign in to join this conversation.