From aa12877191083d0950733920a699b7c4d2ef59a5 Mon Sep 17 00:00:00 2001 From: Luca Bello <36242061+lucabello@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:50:58 +0200 Subject: [PATCH] fix(dashboards): use rate_interval instead of interval (#278) * fix(dashboards): use rate_interval instead of interval * address pr comments * Update src/grafana_dashboards/alertmanager_rev5.json.tmpl Co-authored-by: Mateusz Kulewicz * Update src/grafana_dashboards/alertmanager_rev5.json.tmpl Co-authored-by: Mateusz Kulewicz * Update src/grafana_dashboards/alertmanager_rev5.json.tmpl Co-authored-by: Mateusz Kulewicz * Update src/grafana_dashboards/alertmanager_rev5.json.tmpl Co-authored-by: Mateusz Kulewicz * try to fix charmcraft pack * add charm-binary-python-packages to fix build --------- Co-authored-by: Mateusz Kulewicz --- charmcraft.yaml | 2 +- ....json.tmpl => alertmanager_rev5.json.tmpl} | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) rename src/grafana_dashboards/{alertmanager_rev4.json.tmpl => alertmanager_rev5.json.tmpl} (99%) diff --git a/charmcraft.yaml b/charmcraft.yaml index 232d444f..fcfa8a50 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -11,4 +11,4 @@ bases: channel: "20.04" parts: charm: - charm-binary-python-packages: [ops, PyYAML, cryptography, jsonschema] + charm-binary-python-packages: [ops, PyYAML, cryptography, jsonschema, pydantic, maturin] diff --git a/src/grafana_dashboards/alertmanager_rev4.json.tmpl b/src/grafana_dashboards/alertmanager_rev5.json.tmpl similarity index 99% rename from src/grafana_dashboards/alertmanager_rev4.json.tmpl rename to src/grafana_dashboards/alertmanager_rev5.json.tmpl index ccca48e0..8974ee84 100644 --- a/src/grafana_dashboards/alertmanager_rev4.json.tmpl +++ b/src/grafana_dashboards/alertmanager_rev5.json.tmpl @@ -807,14 +807,14 @@ "steppedLine": false, "targets": [ { - "expr": "sum(histogram_quantile(0.9,rate(alertmanager_notification_latency_seconds_bucket{instance=~\"$instance\"}[$__interval]))) by (integration)", + "expr": "sum(histogram_quantile(0.9,rate(alertmanager_notification_latency_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))) by (integration)", "format": "time_series", "intervalFactor": 1, "legendFormat": "0.9q {{ integration }}", "refId": "B" }, { - "expr": "sum(histogram_quantile(0.99,rate(alertmanager_notification_latency_seconds_bucket{instance=~\"$instance\"}[$__interval]))) by (integration)", + "expr": "sum(histogram_quantile(0.99,rate(alertmanager_notification_latency_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))) by (integration)", "format": "time_series", "interval": "", "intervalFactor": 1, @@ -4700,7 +4700,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -4802,7 +4802,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -4904,7 +4904,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -5006,7 +5006,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_oversize_gossip_message_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -5987,7 +5987,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Nf log query duration", @@ -6088,7 +6088,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Nf log query duration", @@ -6189,7 +6189,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Nf log query duration", @@ -6290,7 +6290,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_nflog_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "intervalFactor": 1, "legendFormat": "Nf log query duration", @@ -6793,7 +6793,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval])", + "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -6895,7 +6895,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval])", + "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -6997,7 +6997,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval])", + "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -7099,7 +7099,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__interval])", + "expr": "rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval]) / rate(alertmanager_nflog_snapshot_duration_seconds_sum{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -8459,7 +8459,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -8561,7 +8561,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -8663,7 +8663,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -8765,7 +8765,7 @@ "steppedLine": false, "targets": [ { - "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__interval]))", + "expr": "histogram_quantile(1,rate(alertmanager_silences_query_duration_seconds_bucket{instance=~\"$instance\"}[$__rate_interval]))", "format": "time_series", "hide": false, "intervalFactor": 1, @@ -10103,7 +10103,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__interval])", + "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "groupBy": [ { @@ -10247,7 +10247,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__interval])", + "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "groupBy": [ { @@ -10391,7 +10391,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__interval])", + "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "groupBy": [ { @@ -10535,7 +10535,7 @@ "steppedLine": false, "targets": [ { - "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__interval])", + "expr": "rate(process_cpu_seconds_total{instance=~\"$instance\"}[$__rate_interval])", "format": "time_series", "groupBy": [ {