From 8aba92e44489e798a792abe1faafbfd29f73b5e1 Mon Sep 17 00:00:00 2001 From: Chris Raible Date: Thu, 7 Nov 2024 10:18:41 -0800 Subject: [PATCH] Fixed CPU Usage chart in grafana dashboard (#21568) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref https://linear.app/ghost/issue/ENG-1505/start-monitoring-ghosts-constraints-and-our-3-goals-using-prometheus - Using `irate` for aggregating CPU usage was resulting in some strange behavior — the CPU Usage chart would zero out after a few mins of running. Switching to regular `rate` seems to have fixed the issue completely. --- .github/scripts/grafana/dashboards/main-dashboard.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/grafana/dashboards/main-dashboard.json b/.github/scripts/grafana/dashboards/main-dashboard.json index 5ddb81dab5..a1347c8d1c 100644 --- a/.github/scripts/grafana/dashboards/main-dashboard.json +++ b/.github/scripts/grafana/dashboards/main-dashboard.json @@ -312,19 +312,19 @@ "steppedLine": false, "targets": [ { - "expr": "irate(ghost_process_cpu_user_seconds_total{job=~\"$job\"}[1m]) * 100", + "expr": "rate(ghost_process_cpu_user_seconds_total{job=~\"$job\"}[1m]) * 100", "interval": "", "legendFormat": "User CPU - {{job}}", "refId": "A" }, { - "expr": "irate(ghost_process_cpu_system_seconds_total{job=~\"$job\"}[1m]) * 100", + "expr": "rate(ghost_process_cpu_system_seconds_total{job=~\"$job\"}[1m]) * 100", "interval": "", "legendFormat": "System CPU - {{job}}", "refId": "B" }, { - "expr": "irate(ghost_process_cpu_seconds_total{job=~\"$job\"}[1m]) * 100", + "expr": "rate(ghost_process_cpu_seconds_total{job=~\"$job\"}[1m]) * 100", "interval": "", "legendFormat": "Total CPU - {{job}}", "refId": "C"