libp2p / libp2p/rust-libp2p

Embrace `prometheus` as a first-class dependency

Open
#3,247 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

decision-pending difficulty:moderate priority:nicetohave
Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

Description

Currently, we collect metrics by inspecting events that are returned from the Swarm and other protocols. Instead of doing that, let's add prometheus as an optional dependency to our components.

Motivation

  • Provide richer metrics by having access to several internals. For example, we could easily report certain buffer sizes as metrics. libp2p-swarm is very much a runtime kind of component. Rich instrumentation will be beneficial for users.
  • Smaller API surface. Currently, we expose certain information (like time to establish a connection) in events only to then capture it in another module again and make it a metric.
  • Easier way of getting started. Users only need to activate a feature and will get metrics. No more passing events around.

Downsides

  • A lock-in on one metric collection system and dependency.

Current Implementation

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

Maybe.

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 the current event-based metrics flow in the Swarm and other protocols, with particular attention to the libp2p-swarm component. Determine the optional dependency and feature boundaries, then define what instrumentation and metric coverage would be needed before considering the migration complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
prometheus, rust
Domain
networking, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.