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

[5.0] Prometheus: Add stable identifier for P2P connections #1750

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Oct 11, 2023

Use the node_id as a stable identifier for P2P connections in prometheus_plugin. The previous connid_# would change on each disconnect/connect.

Example output:

nodeos_p2p_addr{address="localhost:9877 - 539b1ae",connid="539b1ae",ipv6="::ffff:127.0.0.1"} 0
nodeos_p2p_addr{address="localhost:9776 - 9069fa8",connid="9069fa8",ipv6="::ffff:127.0.0.1"} 0
# HELP nodeos_p2p_port port
# TYPE nodeos_p2p_port gauge
nodeos_p2p_port{connid="539b1ae"} 60836
nodeos_p2p_port{connid="9069fa8"} 9776
# HELP nodeos_p2p_connection_number monatomic increasing connection number
# TYPE nodeos_p2p_connection_number gauge
nodeos_p2p_connection_number{connid="539b1ae"} 3
nodeos_p2p_connection_number{connid="9069fa8"} 1
# HELP nodeos_p2p_accepting_blocks accepting blocks on connection
# TYPE nodeos_p2p_accepting_blocks gauge
nodeos_p2p_accepting_blocks{connid="539b1ae"} 1
nodeos_p2p_accepting_blocks{connid="9069fa8"} 1
# HELP nodeos_p2p_last_received_block last received block on connection
# TYPE nodeos_p2p_last_received_block gauge
nodeos_p2p_last_received_block{connid="539b1ae"} 583
nodeos_p2p_last_received_block{connid="9069fa8"} 316
# HELP nodeos_p2p_first_available_block first block available from connection
# TYPE nodeos_p2p_first_available_block gauge
nodeos_p2p_first_available_block{connid="539b1ae"} 0
nodeos_p2p_first_available_block{connid="9069fa8"} 0
# HELP nodeos_p2p_last_available_block last block available from connection
# TYPE nodeos_p2p_last_available_block gauge
nodeos_p2p_last_available_block{connid="539b1ae"} 9
nodeos_p2p_last_available_block{connid="9069fa8"} 6
# HELP nodeos_p2p_unique_first_block_count number of blocks first received from any connection on this connection
# TYPE nodeos_p2p_unique_first_block_count gauge
nodeos_p2p_unique_first_block_count{connid="539b1ae"} 0
nodeos_p2p_unique_first_block_count{connid="9069fa8"} 49
# HELP nodeos_p2p_latency last calculated latency with connection
# TYPE nodeos_p2p_latency gauge
nodeos_p2p_latency{connid="539b1ae"} 1225407
nodeos_p2p_latency{connid="9069fa8"} 1603551
# HELP nodeos_p2p_bytes_received total bytes received on connection
# TYPE nodeos_p2p_bytes_received gauge
nodeos_p2p_bytes_received{connid="539b1ae"} 116491
nodeos_p2p_bytes_received{connid="9069fa8"} 124636
# HELP nodeos_p2p_last_bytes_received last time anything received from peer
# TYPE nodeos_p2p_last_bytes_received gauge
nodeos_p2p_last_bytes_received{connid="539b1ae"} 1.69703998090273e+18
nodeos_p2p_last_bytes_received{connid="9069fa8"} 1.697039987312463e+18
# HELP nodeos_p2p_bytes_sent total bytes sent to peer
# TYPE nodeos_p2p_bytes_sent gauge
nodeos_p2p_bytes_sent{connid="539b1ae"} 342367
nodeos_p2p_bytes_sent{connid="9069fa8"} 289252
# HELP nodeos_p2p_last_bytes_sent last time anything sent to peer
# TYPE nodeos_p2p_last_bytes_sent gauge
nodeos_p2p_last_bytes_sent{connid="539b1ae"} 1.697039988851183e+18
nodeos_p2p_last_bytes_sent{connid="9069fa8"} 1.69703998885119e+18
# HELP nodeos_p2p_connection_start_time time of last connection to peer
# TYPE nodeos_p2p_connection_start_time gauge
nodeos_p2p_connection_start_time{connid="539b1ae"} 1.697039480900622e+18
nodeos_p2p_connection_start_time{connid="9069fa8"} 1.697039478899002e+18

Resolves #1683

@heifner heifner marked this pull request as ready for review October 11, 2023 16:57
@heifner heifner requested review from jgiszczak and linh2931 October 11, 2023 16:58
@heifner heifner added the OCI Work exclusive to OCI team label Oct 11, 2023
@heifner heifner merged commit b317322 into release/5.0 Oct 12, 2023
21 checks passed
@heifner heifner deleted the GH-1683-stable-id-5.0 branch October 12, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus metrics for nodeos_p2p_connections don't use stable identifier in 5.0
3 participants