Fix join errors in initial seed peer versions dashboard (#2811)

* Add metrics gauges for the most recent peer network protocol version

This gague lets us join the initial seeds to the network protocol versions,
even if the peer upgrades and reconnects with a different version.

* Ensure dashboard peer network versions are unique

Otherwise, prometheus returns an error,
and the dashboard shows no data.

* Make seeder labels more readable

- put labels to the right of the graph
- remove default ports

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
This commit is contained in:
teor 2021-10-01 11:05:00 +10:00 committed by GitHub
parent eb99081a9a
commit 966f52a280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 31 deletions

View File

@ -16,7 +16,7 @@
"gnetId": null,
"graphTooltip": 0,
"id": 7,
"iteration": 1632879075996,
"iteration": 1632966001778,
"links": [],
"panels": [
{
@ -40,10 +40,14 @@
"hiddenSeries": false,
"id": 2,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": false,
"hideZero": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
@ -74,7 +78,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum by (remote_version, seed) (zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"} * on(remote_ip) group_left(remote_version) zcash_net_peers_connected{job=\"$job\"})",
"expr": "sum by (remote_version, seed) (label_replace(zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"}, \"seed\", \"$1\", \"seed\", \"(.*):1?8233\") * on(remote_ip) group_left(remote_version) (count_values by (remote_ip) (\"remote_version\", zcash_net_peers_version_connected{job=\"$job\"})))",
"instant": false,
"interval": "",
"legendFormat": "{{remote_version}} - {{seed}}",
@ -88,7 +92,7 @@
"title": "Compatible Seed Peers - $job",
"tooltip": {
"shared": true,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
@ -145,10 +149,14 @@
"hiddenSeries": false,
"id": 12,
"legend": {
"alignAsTable": false,
"avg": false,
"current": false,
"hideEmpty": false,
"hideZero": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
@ -164,7 +172,7 @@
"pointradius": 2,
"points": false,
"renderer": "flot",
"repeatIteration": 1632879075996,
"repeatIteration": 1632966001778,
"repeatPanelId": 2,
"scopedVars": {
"job": {
@ -180,7 +188,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum by (remote_version, seed) (zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"} * on(remote_ip) group_left(remote_version) zcash_net_peers_connected{job=\"$job\"})",
"expr": "sum by (remote_version, seed) (label_replace(zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"}, \"seed\", \"$1\", \"seed\", \"(.*):1?8233\") * on(remote_ip) group_left(remote_version) (count_values by (remote_ip) (\"remote_version\", zcash_net_peers_version_connected{job=\"$job\"})))",
"instant": false,
"interval": "",
"legendFormat": "{{remote_version}} - {{seed}}",
@ -194,7 +202,7 @@
"title": "Compatible Seed Peers - $job",
"tooltip": {
"shared": true,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
@ -255,6 +263,7 @@
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
@ -285,7 +294,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum by (remote_version, seed) (zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"} * on(remote_ip) group_left(remote_version) zcash_net_peers_obsolete{job=\"$job\"})",
"expr": "sum by (remote_version, seed) (label_replace(zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"}, \"seed\", \"$1\", \"seed\", \"(.*):1?8233\") * on(remote_ip) group_left(remote_version) (count_values by (remote_ip) (\"remote_version\", zcash_net_peers_version_obsolete{job=\"$job\"})))",
"instant": false,
"interval": "",
"legendFormat": "{{remote_version}} - {{seed}}",
@ -299,7 +308,7 @@
"title": "Obsolete Seed Peers - $job",
"tooltip": {
"shared": true,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
@ -360,6 +369,7 @@
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": false
@ -375,7 +385,7 @@
"pointradius": 2,
"points": false,
"renderer": "flot",
"repeatIteration": 1632879075996,
"repeatIteration": 1632966001778,
"repeatPanelId": 11,
"scopedVars": {
"job": {
@ -391,7 +401,7 @@
"targets": [
{
"exemplar": true,
"expr": "sum by (remote_version, seed) (zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"} * on(remote_ip) group_left(remote_version) zcash_net_peers_obsolete{job=\"$job\"})",
"expr": "sum by (remote_version, seed) (label_replace(zcash_net_peers_initial{job=\"$job\",seed=~\"$seed\"}, \"seed\", \"$1\", \"seed\", \"(.*):1?8233\") * on(remote_ip) group_left(remote_version) (count_values by (remote_ip) (\"remote_version\", zcash_net_peers_version_obsolete{job=\"$job\"})))",
"instant": false,
"interval": "",
"legendFormat": "{{remote_version}} - {{seed}}",
@ -405,7 +415,7 @@
"title": "Obsolete Seed Peers - $job",
"tooltip": {
"shared": true,
"sort": 0,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
@ -585,7 +595,7 @@
"pointradius": 2,
"points": false,
"renderer": "flot",
"repeatIteration": 1632879075996,
"repeatIteration": 1632966001778,
"repeatPanelId": 4,
"scopedVars": {
"job": {
@ -794,7 +804,7 @@
"pointradius": 2,
"points": false,
"renderer": "flot",
"repeatIteration": 1632879075996,
"repeatIteration": 1632966001778,
"repeatPanelId": 7,
"scopedVars": {
"job": {
@ -904,25 +914,12 @@
{
"allValue": ".+",
"current": {
"selected": true,
"tags": [],
"selected": false,
"text": [
"dnsseed.str4d.xyz:8233",
"dnsseed.testnet.z.cash:18233",
"dnsseed.z.cash:8233",
"mainnet.is.yolo.money:8233",
"mainnet.seeder.zfnd.org:8233",
"testnet.is.yolo.money:18233",
"testnet.seeder.zfnd.org:18233"
"All"
],
"value": [
"dnsseed.str4d.xyz:8233",
"dnsseed.testnet.z.cash:18233",
"dnsseed.z.cash:8233",
"mainnet.is.yolo.money:8233",
"mainnet.seeder.zfnd.org:8233",
"testnet.is.yolo.money:18233",
"testnet.seeder.zfnd.org:18233"
"$__all"
]
},
"datasource": null,
@ -952,12 +949,12 @@
]
},
"time": {
"from": "now-15m",
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "peers",
"uid": "S29TgUH7k",
"version": 22
"version": 31
}

View File

@ -596,6 +596,7 @@ pub async fn negotiate_version(
"disconnecting from peer with obsolete network protocol version"
);
// the value is the number of rejected handshakes, by peer IP and protocol version
metrics::counter!(
"zcash.net.peers.obsolete",
1,
@ -604,6 +605,13 @@ pub async fn negotiate_version(
"min_version" => min_version.to_string(),
);
// the value is the remote version of the most recent rejected handshake from each peer
metrics::gauge!(
"zcash.net.peers.version.obsolete",
remote_version.0.into(),
"remote_ip" => their_addr.to_string(),
);
// Disconnect if peer is using an obsolete version.
Err(HandshakeError::ObsoleteVersion(remote_version))?;
} else {
@ -617,6 +625,7 @@ pub async fn negotiate_version(
"negotiated network protocol version with peer"
);
// the value is the number of connected handshakes, by peer IP and protocol version
metrics::counter!(
"zcash.net.peers.connected",
1,
@ -625,6 +634,13 @@ pub async fn negotiate_version(
"negotiated_version" => negotiated_version.to_string(),
"min_version" => min_version.to_string(),
);
// the value is the remote version of the most recent connected handshake from each peer
metrics::gauge!(
"zcash.net.peers.version.connected",
remote_version.0.into(),
"remote_ip" => their_addr.to_string(),
);
}
peer_conn.send(Message::Verack).await?;