-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(libp2p): track bandwidth per transport protocol stack #4727
Conversation
Previously one could use the `with_bandwidth_logging` to measure the overall bandwidth usage, only differentiated by inbound and outbound traffic. With this commit bandwidth can be tracked per transport protocol stack (e.g. `/ip4/tcp`). In addition this commit adds the ability to redirect these metrics to a `prometheus_client::Registry`. ``` bandwidth_total{protocols="/ip4/tcp",direction="inbound"} 363 bandwidth_total{protocols="/ip4/tcp",direction="outbound"} 348 ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments but overall this is pretty exciting :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks really nice Max! Thanks for going ahead and implement it, and thanks Thomas also reviewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Looking forward to land this :)
…andwidth-metrics-per-protocol
@thomaseizinger @jxs this is ready for a full review. Thank you for the comments thus far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you Max!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great Max, thanks for this!
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Thank you for the help! |
@mxinden Needs rustfmt. |
…andwidth-metrics-per-protocol
@thomaseizinger CI catching my mistakes 🎉
|
Description
Previously one could use the
with_bandwidth_logging
to measure the overall bandwidth usage, only differentiated by inbound and outbound traffic.With this commit bandwidth can be tracked per transport protocol stack (e.g.
/ip4/tcp
) exposed as Prometheus metrics throughlibp2p_metrics::BandwidthMetricTransport
.Notes & open questions
@jxs this is my suggestion on how to expose bandwidth metrics. What do you think?
Change checklist