fix: observed-vs-expected share panel rendered empty
deploy / fetch (push) Successful in 16s
deploy / deploy-node (bob.hanzalova.internal, 0x134e73f06fa9bdb1dbfa909e149c563f5860ceb71a0e7307918f7033970edf59, benjy.hanzalova.internal quadbrat.hanzalova.internal, --public-addr /dns4/nh.thgttg.com/tcp/30333, --unsafe-rpc-external --rpc-methods safe --rpc-c… (push) Successful in 34s
deploy / deploy-miner (1, quadbrat.hanzalova.internal, bob.hanzalova.internal) (push) Successful in 40s
deploy / deploy-miner (1, benjy.hanzalova.internal, bob.hanzalova.internal) (push) Successful in 41s
deploy / deploy-metrics (push) Successful in 14s

sum() strips labels while quantus_network_hashrate carries job and
instance, so the division matched nothing. Use scalar(), and take the
numerator from the hashes counter rather than the spiky gauge.
This commit is contained in:
Rob Thijssen
2026-09-03 10:00:49 +03:00
parent 62f8887f48
commit 05a071352d
+8 -8
View File
@@ -9,7 +9,7 @@
],
"timezone": "browser",
"schemaVersion": 39,
"version": 8,
"version": 9,
"refresh": "30s",
"time": {
"from": "now-6h",
@@ -1595,10 +1595,10 @@
"uid": "prometheus"
},
"editorMode": "code",
"expr": "quantus_share_observed",
"legendFormat": "observed",
"refId": "A",
"range": true,
"refId": "A"
"expr": "quantus_share_observed",
"legendFormat": "observed"
},
{
"datasource": {
@@ -1606,10 +1606,10 @@
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(miner_hash_rate{job=\"quantus-miner\"}) / quantus_network_hashrate",
"legendFormat": "expected",
"refId": "B",
"range": true,
"refId": "B"
"expr": "sum(rate(miner_hashes_total{job=\"quantus-miner\"}[5m])) / scalar(quantus_network_hashrate)",
"legendFormat": "expected"
}
],
"fieldConfig": {
@@ -1637,7 +1637,7 @@
"sort": "desc"
}
},
"description": "THE panel. Expected is our hashrate over the network's; observed is the fraction of blocks we actually authored. Observed persistently below expected is orphan and stale-work loss \u2014 the only honest measure of whether connectivity tuning bought anything (issue #1). Needs hours of data to be more than noise, and both lines are meaningless until Syncing reads 0."
"description": "THE panel. Expected is our hashrate over the network's; observed is the fraction of blocks we actually authored. Observed persistently below expected is orphan and stale-work loss.\n\nscalar() is load-bearing: sum() strips labels while quantus_network_hashrate carries job/instance, so a plain division matches nothing and the panel renders empty \u2014 which is exactly how it shipped. And the numerator is the hashes counter, not the miner_hash_rate gauge, which spikes to impossible values after a restart.\n\nNeeds hours to mean anything, and both lines are meaningless while Syncing reads 1."
},
{
"type": "timeseries",