Skip to content
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

feature: Metrics for GossipSub #534

Open
MarcoPolo opened this issue Jun 28, 2023 · 5 comments
Open

feature: Metrics for GossipSub #534

MarcoPolo opened this issue Jun 28, 2023 · 5 comments

Comments

@MarcoPolo
Copy link
Contributor

Metrics such as:

  • Peer prune rate per topic. How often a peer is pruning us per topic.
  • Peer counts per topic. How many peers do we have per topic.
  • Peer churn rate per topic. The sum of grafts+prunes per topic.

We should also include some grafana dashboards.

This should help node operators identify when their node is running into issues, or when GossipSub is limping along but still working.

@vyzo
Copy link
Collaborator

vyzo commented Jun 29, 2023

You can easily implement this with a tracer.

So an option to enable metrics, that hooks a tracer into you preferred metrics system is something the library could provide == see how it is handled in lotus.

Changing protocol code to directly hook metrics is not acceptable however.

@nisdas
Copy link
Contributor

nisdas commented Jun 29, 2023

In Prysm, we have already implemented something pretty similar using a raw tracer:
https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/p2p/pubsub_tracer.go . It has been helpful in us identifying interesting spikes of certain control messages in the network for different topics. If a tailored metrics tracer for gossipsub lives inside go-libp2p-pubsub that would be a welcome addition on our end as we would no longer need to maintain the above.

@MarcoPolo
Copy link
Contributor Author

If you’d consider upstreaming a patch, I’d be happy to review

@nisdas
Copy link
Contributor

nisdas commented Jun 29, 2023

Thank you for the offer, I am bit occupied over the next few weeks, but once I get some bandwidth I can open up a PR for this to be upstreamed if no-one has done it yet.

@vyzo
Copy link
Collaborator

vyzo commented Jun 29, 2023

Please use a metrics subpackage in any pr for this, so that people who don't use the metrics don't incur any extra dependencies.

Just to be clear, I also think it would be a welcome addition to have in tree support for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants