Fix cache hit rate on APM and Fly.io dashboards #177
5 changed files with 7 additions and 4 deletions
|
|
@ -90,6 +90,7 @@ data:
|
|||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": { "mode": "thresholds" },
|
||||
"mappings": [{ "type": "special", "options": { "match": "null+nan", "result": { "text": "No traffic", "color": "text" } } }],
|
||||
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "yellow", "value": 0.5 }, { "color": "green", "value": 0.8 }] },
|
||||
"unit": "percentunit"
|
||||
},
|
||||
|
|
@ -106,7 +107,7 @@ data:
|
|||
"textMode": "auto"
|
||||
},
|
||||
"targets": [
|
||||
{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(flyio_nginx_cache_requests_total{host=\"cv.eblu.me\",cache_status=\"HIT\"}[5m])) / sum(rate(flyio_nginx_cache_requests_total{host=\"cv.eblu.me\"}[5m]))", "refId": "A" }
|
||||
{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(increase(flyio_nginx_cache_requests_total{host=\"cv.eblu.me\",cache_status=\"HIT\"}[$__range])) / sum(increase(flyio_nginx_cache_requests_total{host=\"cv.eblu.me\"}[$__range]))", "refId": "A" }
|
||||
],
|
||||
"title": "Cache Hit Ratio",
|
||||
"type": "stat"
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ data:
|
|||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": { "mode": "thresholds" },
|
||||
"mappings": [{ "type": "special", "options": { "match": "null+nan", "result": { "text": "No traffic", "color": "text" } } }],
|
||||
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "yellow", "value": 0.5 }, { "color": "green", "value": 0.8 }] },
|
||||
"unit": "percentunit"
|
||||
},
|
||||
|
|
@ -106,7 +107,7 @@ data:
|
|||
"textMode": "auto"
|
||||
},
|
||||
"targets": [
|
||||
{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(flyio_nginx_cache_requests_total{host=\"docs.eblu.me\",cache_status=\"HIT\"}[5m])) / sum(rate(flyio_nginx_cache_requests_total{host=\"docs.eblu.me\"}[5m]))", "refId": "A" }
|
||||
{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(increase(flyio_nginx_cache_requests_total{host=\"docs.eblu.me\",cache_status=\"HIT\"}[$__range])) / sum(increase(flyio_nginx_cache_requests_total{host=\"docs.eblu.me\"}[$__range]))", "refId": "A" }
|
||||
],
|
||||
"title": "Cache Hit Ratio",
|
||||
"type": "stat"
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ data:
|
|||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"color": { "mode": "thresholds" },
|
||||
"mappings": [{ "type": "special", "options": { "match": "null+nan", "result": { "text": "No traffic", "color": "text" } } }],
|
||||
"thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "yellow", "value": 0.5 }, { "color": "green", "value": 0.8 }] },
|
||||
"unit": "percentunit"
|
||||
},
|
||||
|
|
@ -117,7 +118,7 @@ data:
|
|||
"textMode": "auto"
|
||||
},
|
||||
"targets": [
|
||||
{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(rate(flyio_nginx_cache_requests_total{instance=\"flyio-proxy\",cache_status=\"HIT\"}[5m])) / sum(rate(flyio_nginx_cache_requests_total{instance=\"flyio-proxy\"}[5m]))", "refId": "A" }
|
||||
{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(increase(flyio_nginx_cache_requests_total{instance=\"flyio-proxy\",cache_status=\"HIT\"}[$__range])) / sum(increase(flyio_nginx_cache_requests_total{instance=\"flyio-proxy\"}[$__range]))", "refId": "A" }
|
||||
],
|
||||
"title": "Cache Hit Ratio",
|
||||
"type": "stat"
|
||||
|
|
|
|||
1
docs/changelog.d/fix-cache-hit-rate-dashboards.bugfix.md
Normal file
1
docs/changelog.d/fix-cache-hit-rate-dashboards.bugfix.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fix cache hit rate panels on APM and Fly.io dashboards showing blank/red or misleading 100% for low-traffic static sites.
|
||||
|
|
@ -79,7 +79,6 @@ loki.process "nginx" {
|
|||
name = "flyio_nginx_cache_requests_total"
|
||||
description = "Total cache lookups by cache status."
|
||||
source = "cache_status"
|
||||
match_all = true
|
||||
action = "inc"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue