Skip to content

Implement a per-region bandwidth accounting log so operators can see how much data was served to and from each geographic region for capacity planning and regulatory compliance reporting #750

Description

@alpergundogdu

The node currently tracks per-peer reputation and payment vouchers but has no aggregated view of bytes served broken down by the region field from NodeAnnounce. A structured periodic log or admin endpoint showing bytes-in/bytes-out per region would help operators optimize regional capacity bonding and satisfy any data-residency reporting requirements.


Filed via GitDailyReporterBot

Activity

  1. added
    kind:docs
    kind:feature
    on May 31, 2026
  2. github-actions commented on May 31, 2026

    @github-actions

    🎯 Triage report

    This feature request asks for per-region bytes-in/bytes-out accounting surfaced via a structured periodic log or admin endpoint. The region dimension would come from the region field in NodeAnnounce gossip messages. The stated use cases are capacity-bonding optimization and data-residency/regulatory compliance reporting.

    The request is underspecified in a few ways: it doesn't propose where the state lives (e.g. reputation crate EWMA-style, or a new node-level counter map), what the admin RPC shape would look like, or how region attribution flows from the serving handler to the accounting layer. It also touches ADR 036 territory (bytesPerEpoch / FeeRouter) and the existing decdn_bytes_served_total work (#317).

    📊 Assessment

    Dimension Value Reasoning
    Type Feature New observability/reporting capability, not a bug fix
    Labels enhancement, technical, rust Already has enhancement + technical; adding rust aligns with #418 which is the closest precedent
    Coding agent Needs more info Scope and design are underspecified — region attribution path from serving handler → accounting store is not defined, nor is the admin RPC contract

    🔗 Similar issues

    💡 Notes and suggestions

    Design questions to answer before implementation:

    1. Region attribution source: NodeAnnounce.region is a self-attested field on the peer side (ADR 030). For bytes served to clients, there is no client-side region in the current wire protocol. Maintainers should clarify: is this tracking (a) bytes served by this node broken down by the node's own region, (b) bytes served to peers grouped by their NodeAnnounce.region, or (c) something else?

    2. State location: Options include a HashMap<String, (u64, u64)> (region → in/out bytes) inside the node's serving handler, an extension to DecdnMetrics using labeled Prometheus counters (decdn_bytes_served_total{region="us-east"} etc.), or a new RegionAccountant struct. Labeled counters would reuse the existing metrics pipeline and be queryable by Prometheus/Grafana without a separate admin endpoint.

    3. Admin endpoint vs. structured log: ADR appendix-local-admin-http and the AdminRpc trait are the correct extension points if a queryable endpoint is wanted. A structured log (tracing span with region tag) is much simpler and sufficient for most compliance use cases.

    4. ADR 036 interaction: FeeRouter.bytesPerEpoch is already the governance-canonical bytes counter. If the per-region breakdown is meant to feed epoch-level accounting, the design should align with that epoch boundary and the windowEpochs parameter rather than introduce a parallel counter.

    Suggested sub-tasks (if proceeding):

    • Clarify region attribution semantics (see Q1 above)
    • Decide on state representation: labeled Prometheus counter vs. in-memory map vs. new admin RPC field
    • If Prometheus labels: add region label to decdn_bytes_served_total in Implement cdn/client/v1 paid delivery protocol (StreamRequest, StreamResponse, ChunkData, vouchers) #317 scope (or as a follow-on to that issue)
    • If admin endpoint: extend AdminRpc trait in common with a region_stats RPC returning Vec<(String, u64, u64)>
    • Implement counter increments in the cdn/client/v1 serving handler in crates/node/
    • Consider data-residency logging requirements: structured tracing events with region tag may satisfy compliance needs without a queryable endpoint

    Leaf-crate constraint reminder: decdn-node → decdn-cache direction is fine; any new accounting state touching region labels must live in node or common, not in cache or gossip (which are leaf crates per CLAUDE.md dependency rules).

    Generated by Agentic Triage for issue #750 · sonnet46 527.4K · ◷

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/issue-triage.md@94ec5db57374c5b04a4b8eef8b4413f9af44d63f
    
  3. added
    rust
    on May 31, 2026
  4. self-assigned this
    on Jun 4, 2026
  5. removed
    kind:docs
    on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind:featureprio:lowrust

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions