From cf9a93fd712c510e0baec3cb1d9e098f1eb6bddf Mon Sep 17 00:00:00 2001 From: dhpowrhost Date: Wed, 8 Dec 2021 17:21:23 +0100 Subject: [PATCH] Update dashboard.json (#73) Calculating varnish hitrate using varnish_main_client_req will never be accurate, and the way varnish calculates this is cache_hits / cache_hits + cache_miss, so this change commit will use the varnish way of calculating hitrate --- dashboards/jonnenauha/dashboard.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboards/jonnenauha/dashboard.json b/dashboards/jonnenauha/dashboard.json index ce5fd79..ec75131 100644 --- a/dashboards/jonnenauha/dashboard.json +++ b/dashboards/jonnenauha/dashboard.json @@ -113,7 +113,7 @@ "tableColumn": "Value", "targets": [ { - "expr": "avg(( rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) / rate(varnish_main_client_req{instance=~\"^($varnish_instance).*\"}[5m]) ))", + "expr": "avg((rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) / (rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) + rate(varnish_main_cache_miss{instance=~\"^($varnish_instance).*\"}[5m]))))", "format": "time_series", "hide": false, "interval": "", @@ -1046,7 +1046,7 @@ "steppedLine": true, "targets": [ { - "expr": "avg(rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) / rate(varnish_main_client_req{instance=~\"^($varnish_instance).*\"}[5m]))", + "expr": "rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) / (rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) + rate(varnish_main_cache_miss{instance=~\"^($varnish_instance).*\"}[5m]))", "format": "time_series", "hide": false, "interval": "", @@ -1056,7 +1056,7 @@ "step": 240 }, { - "expr": "avg(1 - (rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) / rate(varnish_main_client_req{instance=~\"^($varnish_instance).*\"}[5m])))", + "expr": "rate(varnish_main_cache_miss{instance=~\"^($varnish_instance).*\"}[5m]) / (rate(varnish_main_cache_hit{instance=~\"^($varnish_instance).*\"}[5m]) + rate(varnish_main_cache_miss{instance=~\"^($varnish_instance).*\"}[5m]))", "format": "time_series", "hide": false, "interval": "",