Hi,
I have a problems with single stat value in my grafana, the value is not the same if i check in Dashboard or in Edit panel. I’ve check my values manually and the correct value is show in “Edit panel”.
Some informations about my configuration:
Grafana version : Grafana Cloud
Data collected : Log file with grafana-agent and loki on raspberry
Log query : sum(count_over_time({filename=~^(/var/www/api/current/logs/all/log(\W|[0-9])*log)$
} |=“http” [1s]))
Data exemple :
Summary
[18:21:40][http] GET /api/v1/resources/36 200 1558 - 2.412 ms
[18:21:40][http] GET /api/v1/resources/1 200 323 - 1.745 ms
[18:21:41][http] GET /api/v1/maps/latest 200 44 - 1.443 ms
[18:24:47][http] POST /api/resources/add 404 157 - 0.564 ms
[18:25:41][http] GET /api/v1/resources/304 - - 2.223 ms
[18:25:41][http] GET /api/v1//category 304 - - 1.981 ms
[18:25:42][http] GET /api/v1/resources/28 304 - - 2.336 ms
[18:25:42][http] GET /api/v1/resources/26 304 - - 2.290 ms
[18:25:42][http] GET /api/v1/resources/24 304 - - 2.014 ms
[18:25:42][http] GET /api/v1/resources/2 304 - - 2.059 ms
[18:25:42][http] GET /api/v1/resources/1 304 - - 1.978 ms
[18:25:42][http] GET /api/v1/resources/36 304 - - 2.357 ms
Json config :
Summary
{
“id”: 36,
“gridPos”: {
“h”: 3,
“w”: 3,
“x”: 3,
“y”: 0
},
“type”: “stat”,
“title”: “Total number of request”,
“datasource”: {
“type”: “loki”,
“uid”: “${loki_datasource}”
},
“pluginVersion”: “8.4.1”,
“fieldConfig”: {
“defaults”: {
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
},
{
“color”: “red”,
“value”: 80
}
]
},
“color”: {
“mode”: “thresholds”
}
},
“overrides”:
},
“options”: {
“reduceOptions”: {
“values”: false,
“calcs”: [
“sum”
],
“fields”: “”
},
“orientation”: “auto”,
“textMode”: “auto”,
“colorMode”: “none”,
“graphMode”: “none”,
“justifyMode”: “auto”
},
“targets”: [
{
“datasource”: {
“type”: “loki”,
“uid”: “${loki_datasource}”
},
“expr”: “sum(count_over_time({filename=~^(/var/www/dtapi/current/logs/all/log(\\W|[0-9])*log)$
} |=“http” [1s]))”,
“hide”: false,
“legendFormat”: “t”,
“maxLines”: 1000000,
“refId”: “B”
}
]
}
I hope all informations can be helpfull to resolve this problems, because i don’t understand why the query works in edit panel and not in dashboard.
Thanks for your help