mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-05 12:33:15 +00:00
fix(dashboard_gen): use RATE_WINDOW in rate_per_min calculation
This commit is contained in:
parent
037901fe94
commit
acb73dce0c
@ -71,7 +71,7 @@
|
|||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||||
"expr": "rate(blocks_produced_total[1m]) * 60",
|
"expr": "rate(blocks_produced_total[$__rate_interval]) * 60",
|
||||||
"legendFormat": "produced · blocks/min",
|
"legendFormat": "produced · blocks/min",
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
}
|
}
|
||||||
@ -327,19 +327,19 @@
|
|||||||
"targets": [
|
"targets": [
|
||||||
{
|
{
|
||||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||||
"expr": "rate(submitted_transactions_total[1m]) * 60",
|
"expr": "rate(submitted_transactions_total[$__rate_interval]) * 60",
|
||||||
"legendFormat": "submitted",
|
"legendFormat": "submitted",
|
||||||
"refId": "A"
|
"refId": "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||||
"expr": "rate(before_mempool_failed_transactions_total[1m]) * 60",
|
"expr": "rate(before_mempool_failed_transactions_total[$__rate_interval]) * 60",
|
||||||
"legendFormat": "failed · before mempool",
|
"legendFormat": "failed · before mempool",
|
||||||
"refId": "B"
|
"refId": "B"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
"datasource": { "type": "prometheus", "uid": "prometheus" },
|
||||||
"expr": "rate(mempool_failed_transactions_total[1m]) * 60",
|
"expr": "rate(mempool_failed_transactions_total[$__rate_interval]) * 60",
|
||||||
"legendFormat": "failed · in mempool",
|
"legendFormat": "failed · in mempool",
|
||||||
"refId": "C"
|
"refId": "C"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,3 +8,6 @@ datasources:
|
|||||||
url: http://prometheus:9090
|
url: http://prometheus:9090
|
||||||
isDefault: true
|
isDefault: true
|
||||||
editable: true
|
editable: true
|
||||||
|
jsonData:
|
||||||
|
# Must match prometheus.yml's `scrape_interval`
|
||||||
|
timeInterval: 5s
|
||||||
|
|||||||
@ -36,9 +36,10 @@ mod unit;
|
|||||||
/// than by a per-environment URL.
|
/// than by a per-environment URL.
|
||||||
pub const DATASOURCE_UID: &str = "prometheus";
|
pub const DATASOURCE_UID: &str = "prometheus";
|
||||||
|
|
||||||
/// Window every histogram query rates over. `$__rate_interval` tracks the
|
/// Window every rate query — counter and histogram alike — rates over.
|
||||||
/// panel's zoom, so a percentile covers the range you are actually looking at,
|
/// `$__rate_interval` tracks the panel's zoom, so the window always covers the
|
||||||
/// and an idle window yields no value rather than a zero.
|
/// step Grafana samples at: a fixed one shorter than the step leaves gaps the
|
||||||
|
/// query never looks at, dropping events from the graph entirely.
|
||||||
const RATE_WINDOW: &str = "$__rate_interval";
|
const RATE_WINDOW: &str = "$__rate_interval";
|
||||||
|
|
||||||
/// Dashboard variable holding the quantile every percentile query reads.
|
/// Dashboard variable holding the quantile every percentile query reads.
|
||||||
@ -578,7 +579,9 @@ pub fn avg(metric: &str) -> Target {
|
|||||||
/// A per-minute rate target for a counter metric.
|
/// A per-minute rate target for a counter metric.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn rate_per_min(metric: &str, legend: &str) -> Target {
|
pub fn rate_per_min(metric: &str, legend: &str) -> Target {
|
||||||
Target::new(format!("rate({metric}[1m]) * 60")).legend(legend)
|
//`rate` is per-second whatever the window, so `* 60` is per-minute regardless of the panel's
|
||||||
|
//`rate` zoom.
|
||||||
|
Target::new(format!("rate({metric}[{RATE_WINDOW}]) * 60")).legend(legend)
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn default_unit() -> Unit {
|
const fn default_unit() -> Unit {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user