iotex-core icon indicating copy to clipboard operation
iotex-core copied to clipboard

add node's p2p ID/address to node_info message

Open dustinxie opened this issue 2 years ago • 0 comments

What would you like to be added

the current node_info message has a node's version, operatorAddr, and height iotex_node_info_height_gauge{address="io10a0h7m2gm9cylnztewfctpp87sc6t69pc0y3ep",version="v1.12.0"} 2.6621886e+07

the request is to add the p2pID into this message, which is useful for debugging, like

iotex_node_info_height_gauge{ address="io10a0h7m2gm9cylnztewfctpp87sc6t69pc0y3ep",p2pID="12D3KooWLPPqftrHAh1cs84qbChNpJYUiic7n3aWbKxo8XwbPeyv",version="v1.12.0"} 2.6621886e+07

Why is this needed

Recently I am debugging to find out a delegate node's external IP address, which we can easily get by adding couple of log lines in the p2p module, like below:

peer ID = 12D3KooWEVsAky5p8gVwBLxYKBXxpHrPY4XVvjehnkH9VxTDkan6
peer addr = /ip4/217.160.194.176/tcp/4689
peer ID = 12D3KooWRxY4dnvUEmYMY6dDPb6e8BrAJbNdhnNvimNYM7tntuqB
peer addr = /ip4/35.73.233.71/tcp/6622
peer ID = 12D3KooWDzSx63WmqkNv7LNxkM2ouqWCE8Y9bEC8m8mRJV17W4n3
peer addr = /ip4/34.124.229.185/tcp/4689

however, since we don't know a node's p2pID (which only shows 1 time at the beginning of log), I cannot connect the IP address to which node it is. Adding the p2pID into node_info message would make this possible

How important you think this is for IoTeX

  • [] must have
  • [x] should have
  • [] nice to have

Additional information

Let us know any background or context that would help us better understand the request (for example the particular use-case that prompted this request)

dustinxie avatar Nov 01 '23 05:11 dustinxie