-
Notifications
You must be signed in to change notification settings - Fork 747
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
improve libp2p connected peer metrics #4870
Conversation
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.
LGTM, relevant metrics on running a node look right.
Also, think the libp2p_inbound_bytes
metric should be renamed to libp2p_bytes
// We have SOCKET_UPDATED messages. This occurs when discovery has a majority of | ||
// users reporting an external port and our ENR gets updated. | ||
// Which means we are able to do NAT traversal. | ||
metrics::set_gauge(&metrics::NAT_OPEN, 1); |
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.
Just curious, this is only true for the discv5 udp port though right?
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.
right! Thanks Pawan, had missed this and now understand why there was the check_nat
function, but it was using an OR (||) instead of an AND (&&) which also ignored what you have just mentioned.
I updated the metric to count both discovery and libp2p ports
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.
Yeah nice. Grouping is good.
Have we tested this on a network yet?
@mergify queue |
🛑 The pull request has been removed from the queue
|
@Mergifyio requeue |
✅ This pull request will be re-embarked automaticallyThe followup |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 0c3fef5 |
* improve libp2p connected peer metrics * separate discv5 port from libp2p for NAT open * use metric family for DISCOVERY_BYTES * Merge branch 'unstable' of https://github.com/sigp/lighthouse into improve-metrics
This reverts commit 0c3fef5.
Issue Addressed
After speaking with @jimmygchen regarding the transport metrics I noticed that they could be improved in the vein of the #4805 to use of the same metric family for collecting multiple properties.
This PR therefore merges all the connected peer metrics into a single family with the transport and direction labels to differentiate inbound and outbound from tcp and quic.
It also moves the assertion of NAT traversal to the two places where we are sure of it, on
Discv5Event::SocketUpdated
and libp2pFromSwarm::ExternalAddressConfirmed
. When we are connected to a libp2p, it may be from a node in the local network.Please confirm everything makes sense. Cc @AgeManning