What Grafana version and what operating system are you using?
Grafana v8.2.2 (6232fe07c0) and Debian 11 (bullseye)
What are you trying to achieve?
I want colors established by threshold change properly as it should.
How are you trying to achieve it?
Asking in grafana community…
What happened?
I’m using Grafana with Zabbix (5.4.6) data source and configured three Stat Panels which monitor from left to right the “Used space” in GB, the “Used space (%)” and the “Total space” in GB, from several Linux machines (mostly CentOS and Debian), as you can see in the following screenshot. The problematic one is the first one “Used space”, the others work fine.
The panels show the values as they should and they work perfectly except for one detail. As you may see in the following screenshot I configured three simple thresholds for the “Used space” (in GB) panel in order to make the background change its color when it reaches each specified % value. Now it’s just red and that’s wrong, because in the case of this machine 17.9GB of 312GB it’s just 6%, then it should be green…
The “Used space (%)” panel works as it should, in this example shows 6% as green and in other machines when reaches more than 50% the color turns yellow and when 80% the color turns red as expected. The only noticeable difference is that I’m using “Thresholds mode” as “Absolute”. In the previous screenshot you can see I’m using “Percentage” mode, already tried to use “Absolute” mode too and didn’t work.
I have a second machine to show as an example of what is happening. The “Used space (%)” panel works as intended, but the first panel “Used space” don’t. The color is yellow when it should be red because is over 80%.
What am I doing wrong? I know this might be a bit stupid post for complaining about a tiny detail, but our customers have access to their own machines dashboards and they noticed and asked us to correct the colors in “Used space” panel, because they like to see green as low used space, yellow as half storage occupied and red as high used space.
If there is anything else I can provide, just let me know.
What did you expect to happen?
As already stated, when used space (in GB) panel reaches 50% background should turn yellow and when it reaches 80% it should turn red.
Can you copy/paste the configuration(s) that you are having problems with?
Here I paste the configuration about “Used space” and “Used space (%)” panels:
"title": "Used space",
"type": "stat"
},
{
"datasource": "Zabbix",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"mappings": [],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "yellow",
"value": 50
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 4,
"x": 10,
"y": 19
},
"hideTimeOverride": false,
"id": 99,
"links": [],
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.2",
"targets": [
{
"application": {
"filter": "/Filesystem./"
},
"functions": [],
"group": {
"filter": "$Group"
},
"host": {
"filter": "$Host"
},
"item": {
"filter": "/: Space utilization"
},
"itemTag": {
"filter": "Application: Filesystem /"
},
"options": {
"disableDataAlignment": false,
"showDisabledItems": false,
"skipEmptyValues": false,
"useZabbixValueMapping": false
},
"proxy": {
"filter": ""
},
"queryType": "0",
"refId": "A",
"resultFormat": "time_series",
"table": {
"skipEmptyValues": false
},
"tags": {
"filter": ""
},
"trigger": {
"filter": ""
},
"triggers": {
"acknowledged": 2,
"count": true,
"minSeverity": 3
}
}
],
"title": "Used space (%)",
"transformations": [],
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 10,
"x": 14,
"y": 19
},
"id": 100,
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "center",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "value"
},
"pluginVersion": "8.2.2",
"targets": [
{
"application": {
"filter": ""
},
"functions": [],
"group": {
"filter": "$Group"
},
"hide": false,
"host": {
"filter": "$Host"
},
"item": {
"filter": "/: Total space"
},
"itemTag": {
"filter": "Application: Filesystem /"
},
"options": {
"disableDataAlignment": false,
"showDisabledItems": false,
"skipEmptyValues": false,
"useZabbixValueMapping": false
},
"proxy": {
"filter": ""
},
"queryType": "0",
"refId": "B",
"resultFormat": "time_series",
"table": {
"skipEmptyValues": false
},
"tags": {
"filter": ""
},
"trigger": {
"filter": ""
},
"triggers": {
"acknowledged": 2,
"count": true,
"minSeverity": 3
}
}
],
I think I didn’t miss any line about config.
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No errors are displayed, this is most likely a configuration problem.
I’ve just found the following lines in “/var/log/grafana/grafana.log”, but I think this lines aren’t related to my problem (I have anonymized the lines because they include sensitive data like public IPs or domains):
2024-03-25T12:18:14+0100 lvl=eror msg="Metric request error" logger=context userId=1 orgId=1 uname=admin error="failed to query data: Failed to query data: rpc error: code = Canceled desc = context canceled" remote_addr=ANONYMOUS_IP
t=2024-03-25T12:18:14+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/ds/query status=500 remote_addr=ANONYMOUS_IP time_ms=19 size=34 referer="https://ANONYMOUS_GRAFANA_DOMAIN/d/xnigio0Sz/pruebas-master-panel?orgId=1&var-Group=ANONYMOUS_GROUP&var-Host=ANONYMOUS_HOSTNAME&editPanel=102"
Did you follow any online instructions? If so, what is the URL?
Yes, I tried to follow several online guides (I didn’t find guides about a Stat panel like my case, only was able to find guides about thresholds colors not working but in bar charts, time series,…), official grafana guides about how to configure thresholds but I did not find a solution.