Open mxinden opened 1 year ago
Do you have a vision for how to implement this without adding a dependency onto prometheus
directly to libp2p-swarm
?
We can use https://github.com/libp2p/rust-libp2p/pull/3180 in combination with the upcoming Prometheus Collector
abstraction https://github.com/prometheus/client_rust/pull/82.
https://github.com/libp2p/rust-libp2p/pull/3180 did not introduce a separation per stream though only a sum across all streams. Also, I am not yet sure how we will be able to associate the protocol with the stream because that one is only available before we inject it into the ConnectionHandler
at a point where the stream has already been handed off from the muxer.
Description
Expose Prometheus metrics counting the number of bytes send and received on streams per protocol.
Rough idea:
Motivation
Allows us to get an intuition of the bandwidth consumption of each of the libp2p protocols.
Requirements
Collector
trait from https://github.com/prometheus/client_rust/pull/82Open questions
Are you planning to do it yourself in a pull request?
Not any time soon. Help is much appreciated.