Exposing Metrics
@sukunrt is already working on this.
Since Feb 27, 2023.
- Dominant language
- Go
- Stars
- 6.9k
- Forks
- 1.3k
- Avg merge
- 13d 21h
- Merged PRs (30d)
- 1
Description
libp2p currently collects a few metrics (for example, for TCP and QUIC). We also collect metrics for the resource manager, however, that is currently left as a responsibility to the application. This is how we end up with slightly different implementations (and metrics names) in go-ipfs and lotus.
In the (very near!) future, we want to expose more metrics from the swarm regarding transports, security protocols and muxers. This would have allowed us to detect the muxer prioritisation bug (https://github.com/ipfs/go-ipfs/pull/8750) a lot earlier.
We therefore should have a coherent libp2p metrics story.
Open questions:
- In the past, we debated if the metrics code should live within the respective repository, or if that code should live separately and hook in via tracers. Note that this issue mostly goes away once we make progress with our repo consolidation (and that's what we should base our designs on).
- Some people have expressed concerns introducing an OpenCensus / Prometheus dependency into the default build introduces too much bloat. Is that a valid concern? Does it really add too much overhead? If so, would it make sense to hide all metrics collection across our code base behind a build flag?
- OpenCensus vs. Prometheus: In the past, we've used both tools, very inconsistently. If I understand correctly, OpenCensus is essentially another abstraction layer between the tracer and Prometheus, and would in theory allow the usage of other tools than Prometheus, although it might be debatable how much we care about that.
Thoughts, @vyzo @aschmahmann @mxinden @Stebalien @lanzafame?
Tracking the various components we want to instrument:
- Resource Manager
- Swarm: https://github.com/libp2p/go-libp2p/issues/1910
- AutoNAT: https://github.com/libp2p/go-libp2p/issues/2017
- Identify: https://github.com/libp2p/go-libp2p/issues/2019
- Relay service: https://github.com/libp2p/go-libp2p/issues/2018
- Eventbus: https://github.com/libp2p/go-libp2p/issues/2020
- Autorelay: https://github.com/libp2p/go-libp2p/issues/2181
- Hole puncher: https://github.com/libp2p/go-libp2p/issues/2103
Supporting work (need to close this issue):
- https://github.com/libp2p/go-libp2p/pull/2180
- https://github.com/libp2p/go-libp2p/pull/2232
- https://github.com/libp2p/blog/issues/69
- https://github.com/libp2p/website/issues/175
defer:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.