libp2p / libp2p/rust-libp2p

misc/metrics: Expose bytes send/received per protocol

Open
#3,262 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty:moderate help wanted
Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

Description

Expose Prometheus metrics counting the number of bytes send and received on streams per protocol.

Rough idea:

libp2p_bytes { direction = "in", protocol = "/ipfs/kad/1.0.0" } 42
libp2p_bytes { direction = "out", protocol = "/ipfs/kad/1.0.0" } 42

Motivation

Allows us to get an intuition of the bandwidth consumption of each of the libp2p protocols.

Requirements

  1. Use https://github.com/libp2p/rust-libp2p/pull/3261
  2. Implement Collector trait from https://github.com/prometheus/client_rust/pull/82

Open questions

Are you planning to do it yourself in a pull request?

Not any time soon. Help is much appreciated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing rust-libp2p pull request 3261 and the prometheus client_rust Collector trait pull request 82. Trace how stream traffic is associated with protocols, then ensure the completed work exposes separate inbound and outbound byte counts for each protocol as Prometheus metrics.

Written by the indexing model from the issue text.

Assessment

Tech stack
prometheus, rust
Domain
networking, observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.