-
What Grafana version and what operating system are you using?
Grafana v10.0.1 and OS is Windows 10. -
What are you trying to achieve? And how** are you trying to achieve it?
My current dashboard(a bar chart) counts #of JSON logs for each one hour, and I want to test whether my dashboards are correct by comparing the results from the dashboards and the results from Explore. The dashboard uses metrics/recording rules; the Explore uses similar queries as the dashboard’s metrics, except the Explore queries don’t include any aggregation functions.
eg. the metric query – sum by(Method) (count_over_time({app=“myApp”} | json | Msg=some msgs
|~some string
[1h]))
the Explore query – {app=“myApp”} |=getAPI
| json | Msg =some msgs
|~some string
-
What happened?
The dashboard shows way much less logs than the Explore’s.
For example, one 2023-10-16 04:00:00, the dashboard only shows 774 logs but the Explore’s shows over 5000 logs (limit is 5000).
-
What did you expect to happen?
I would expect the # of logs of my dashboards and the Explore should be equal. -
Can you copy/paste the configuration(s) that you are having problems with?
Time zone for both dashboard and the Explore is America/Danmarkshavn
Greenland, GMT.
Here is my dashboard’s Panel JSON, and the metric(metricQuery) is used –
sum by(Method) (count_over_time({app=“myApp”} | json | Msg=some msgs
|~some string
[1h]))
{
“datasource”: {
“uid”: “”,
“type”: “prometheus”
},
“fieldConfig”: {
“defaults”: {
“custom”: {
“lineWidth”: 1,
“fillOpacity”: 80,
“gradientMode”: “none”,
“axisPlacement”: “auto”,
“axisLabel”: “”,
“axisColorMode”: “text”,
“scaleDistribution”: {
“type”: “linear”
},
“axisCenteredZero”: false,
“hideFrom”: {
“tooltip”: false,
“viz”: false,
“legend”: false
},
“thresholdsStyle”: {
“mode”: “off”
}
},
“color”: {
“mode”: “thresholds”
},
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
}
]
},
“noValue”: “0”,
“unit”: “string”
},
“overrides”:
},
“gridPos”: {
“h”: 8,
“w”: 12,
“x”: 12,
“y”: 34
},
“id”: 29,
“interval”: “1h”,
“options”: {
“orientation”: “auto”,
“xTickLabelRotation”: 0,
“xTickLabelSpacing”: 0,
“showValue”: “auto”,
“stacking”: “none”,
“groupWidth”: 0.7,
“barWidth”: 0.97,
“barRadius”: 0,
“fullHighlight”: true,
“tooltip”: {
“mode”: “multi”,
“sort”: “none”
},
“legend”: {
“showLegend”: true,
“displayMode”: “list”,
“placement”: “bottom”,
“calcs”: [
“sum”
]
},
“xField”: “Time”
},
“pluginVersion”: “10.0.1”,
“targets”: [
{
“datasource”: {
“type”: “prometheus”,
“uid”: “”
},
“editorMode”: “builder”,
“expr”: “metricQuery:1h{Method="methodName"}”,
“format”: “table”,
“hide”: false,
“range”: true,
“refId”: “methodName”
}
],
“title”: “My dashboard title”,
“type”: “barchart”
}
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
Got a timeout error in the metric rule.