Warp-net/warpnet

Implement Unified Anonymous Metrics Collection

Open

#12 opened on May 20, 2025

View on GitHub
 (0 comments) (0 reactions) (1 assignee)Go (12 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (137 stars)
PR merge metrics
 (PR metrics pending)

Description

To ensure observability, performance tuning, and incident response, we need to implement comprehensive metrics collection across all critical layers of the application stack.

  1. Metrics to Collect:

1.1 Application-Level Metrics:

  • Active users (daily, hourly)
  • Number of posts created
  • Feed views, post views
  • Error rates (e.g. failed requests, invalid messages)

1.2 Deprecated

1.3 libp2p Metrics:

  • Connected peers count
  • Peer churn rate
  • Average RTT per peer
  • Message send/receive rates
  • NAT traversal success rate

1.4 BadgerDB Metrics:

  • LSM and value log sizes
  • GC activity (duration, frequency)
  • Pending writes / stalls

1.5 System Metrics:

  • CPU and memory usage (percent only, without actual numbers)
  • Goroutine count
  • Disk I/O
  • Network I/O (total and per peer)
  1. Integration Targets:
  • Use Prometheus for scraping and querying metrics.
  • Integrate with PushGateway.
  • Organize metrics into clear namespaces like: raft_, p2p_, badger_, app_, sys_.

3.Notes:

  • Avoid high-cardinality labels (e.g. per-user or per-post labels).
  • Ensure metrics collection is non-blocking and minimal in overhead.
  • Some libraries (libp2p, Badger) already expose Prometheus collectors — reuse them if available.
  1. Visualization:
  • Visualize using Graphana

Without metrics, we're effectively flying blind — this task is foundational for debugging, performance optimization, capacity planning, and user behavior analytics.

Looking for contributors familiar with Prometheus, instrumentation, or any of the internal subsystems (Raft, libp2p, BadgerDB).

Contributor guide