libp2p / libp2p/js-libp2p

Track protocol stream open/close count in metrics

Open
#3,262 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted kind/enhancement
Dominant language
TypeScript
Stars
2.6k
Forks
546
Avg merge
8h 18m
Merged PRs (30d)
16

Description

Current metrics include `libp2p_protocol_streams_total` which is a guage of current open protocol streams (with a single label protocol=`direction + " " + protocol`)

It would be more useful to have separate _counter_ metrics for stream open and stream close. This would allow us to compute total (open - close) as well as rates of open and close.

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

Search the TypeScript source for the libp2p_protocol_streams_total metric and the code that records protocol stream opens and closes. Review the existing metric tests, if present, before changing behavior. Done means separate open and close counters expose protocol and direction labels and support calculating current totals and open/close rates.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
networking, observability
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.