Skip to content

Support a decdn node top subcommand that polls /metrics every second and renders a live terminal table of active streams, bytes served, and cache hit rate #275

Closed

Description

@alpergundogdu

Real-time visibility into node activity is currently only possible by scraping /metrics with an external tool; a built-in live view similar to htop would lower the barrier for operators running nodes without a Prometheus/Grafana stack.


Filed via GitDailyReporterBot

Activity

  1. added
    kind:feature
    on Apr 22, 2026
  2. self-assigned this
    on May 6, 2026
  3. thiras commented on May 6, 2026

    @thiras
    Contributor

    Prerequisite gap — not actionable as written

    Audited the metrics and serving path against this issue's three columns. Two of the three don't exist yet:

    Issue asks for Status today
    active streams Closest is decdn_dispatch_in_flight (crates/node/src/metrics.rs:65) — counts QUIC handler tasks, not per-blob streams. Reasonable approximation.
    bytes served ❌ No counter exists. The cache crate (crates/cache/src/) emits zero metrics, and there is no cdn/client/v1 serving handler — only cdn/probe/v1 is wired up in crates/node/src/runtime/mod.rs:121. Nothing is currently streaming bytes to clients to instrument.
    cache hit rate ❌ No cache_hits_total / cache_misses_total. Cache hit/miss happens inside CacheEngine::pull_through but is not surfaced to decdn_* metrics.

    Prerequisite work

    In rough dependency order:

    1. Cache hit/miss counters. Plumb a metrics handle into CacheEngine without making cache depend on node (per decdn/CLAUDE.md's leaf-crate rule — likely a small trait or Fn callback in the cache crate, with the node wiring layer providing the impl).
    2. cdn/client/v1 serving handler. A meaningful "bytes served" only exists once there's a paid-delivery path to instrument. This is core CDN work, well beyond the scope of a node top CLI.
    3. Bytes-served counter in that handler (cumulative Counter, with the TUI computing per-second deltas client-side).

    After 1–3 land, the original issue collapses to ~M effort: parse OpenMetrics text from /metrics, render with ratatui or simpler ANSI redraw, compute deltas between ticks.

    Recommendations

    • Mark blocked until the serving path + metrics land.
    • Optionally split: file separate issues for "cache hit/miss metrics" and "bytes-served counter on serving handler" so each prereq is independently trackable.
    • If a narrower live-view is wanted now, scope it to currently-available metrics (active_connections, dispatch_in_flight, gossip_peer_table_size, uptime_seconds, rpc_healthy, gossip rates) and rename the issue accordingly — but that's a different feature than what the title describes.
  4. added
    status:blocked
    on May 6, 2026
  5. thiras commented on May 6, 2026

    @thiras
    Contributor

    Filed cache instrumentation prereq as #418 (hit/miss + bytes-from-cache counters). Combined with #317 (network-side serving handler), those are the two upstream blockers for this issue.

  6. removed their assignment
    on May 6, 2026
  7. removed
    status:blocked
    on May 6, 2026
  8. thiras commented on May 6, 2026

    @thiras
    Contributor

    Unblocked by #421 (merged in #425, commit ea01130). The new shape is decdn node top (the node admin namespace now lives on the user CLI, not the daemon). No rewrite of this issue's design needed — only the binary placement question is resolved. The work is the metrics renderer.

  9. self-assigned this
    on May 8, 2026
  10. 4 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:feature

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions