-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No data on a stat panel when displaying 'Time' instead of value itself (Public dashboard) #62479
Comments
@spookyrecharge are you able to use the panel > get help button to share a copy of this panel that we can review? Have you noticed if you use developer tools in the browser and inspect the request/response in the network tab while logged in and viewing publicly if there is a difference in the return values or error messages? |
Panel debug snapshot dashboard{
"panels": [
{
"id": 2,
"gridPos": {
"h": 13,
"w": 15,
"x": 0,
"y": 0
},
"type": "stat",
"title": "Reproduced with embedded data",
"datasource": {
"type": "grafana",
"uid": "grafana"
},
"pluginVersion": "9.3.6",
"timeFrom": "7d",
"hideTimeOverride": true,
"fieldConfig": {
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"color": {
"fixedColor": "red",
"mode": "fixed"
},
"unit": "none"
},
"overrides": []
},
"options": {
"reduceOptions": {
"values": false,
"calcs": [
"lastNotNull"
],
"fields": "/^Time$/",
"limit": 1
},
"orientation": "horizontal",
"textMode": "value",
"colorMode": "value",
"graphMode": "none",
"justifyMode": "center"
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "grafana",
"uid": "grafana"
},
"queryType": "snapshot",
"snapshot": [
{
"schema": {
"refId": "A",
"meta": {
"executedQueryString": "SELECT last(\"free_heap\") FROM \"sys\" WHERE time >= now() - 7d and time <= now() fill(none)"
},
"name": "sys.last",
"fields": [
{
"name": "Time",
"type": "time",
"config": {}
},
{
"name": "Value",
"type": "number",
"config": {
"displayNameFromDS": "sys.last"
}
}
]
},
"data": {
"values": [
[
1675112640804
],
[
34344
]
]
}
}
]
}
]
},
{
"gridPos": {
"h": 7,
"w": 9,
"x": 15,
"y": 0
},
"id": 5,
"options": {
"content": "<table width=\"100%\">\n <tr>\n <th width=\"2%\">Panel</th>\n <td >stat @ 9.3.6</td>\n </tr>\n <tr>\n <th>Queries</th>\n <td>A[influxdb]</td>\n </tr>\n \n <tr><th>Data</th><td> 1 frames, 2 fields, 1 rows </td></tr>\n \n <tr>\n <th>Grafana</th>\n <td>9.3.6 (978237e7cb) // Open Source</td>\n </tr>\n </table>",
"mode": "html"
},
"title": "Debug info",
"type": "text"
},
{
"id": 6,
"title": "Original Panel JSON",
"type": "text",
"gridPos": {
"h": 13,
"w": 9,
"x": 15,
"y": 7
},
"options": {
"content": "{\n \"id\": 8,\n \"gridPos\": {\n \"h\": 4,\n \"w\": 4,\n \"x\": 14,\n \"y\": 8\n },\n \"type\": \"stat\",\n \"title\": \"Last power ON state\",\n \"datasource\": {\n \"uid\": \"nnX4Q0D4z\",\n \"type\": \"influxdb\"\n },\n \"pluginVersion\": \"9.3.6\",\n \"timeFrom\": \"7d\",\n \"hideTimeOverride\": true,\n \"fieldConfig\": {\n \"defaults\": {\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\",\n \"value\": null\n }\n ]\n },\n \"color\": {\n \"fixedColor\": \"red\",\n \"mode\": \"fixed\"\n },\n \"unit\": \"none\"\n },\n \"overrides\": []\n },\n \"options\": {\n \"reduceOptions\": {\n \"values\": false,\n \"calcs\": [\n \"lastNotNull\"\n ],\n \"fields\": \"/^Time$/\",\n \"limit\": 1\n },\n \"orientation\": \"horizontal\",\n \"textMode\": \"value\",\n \"colorMode\": \"value\",\n \"graphMode\": \"none\",\n \"justifyMode\": \"center\"\n },\n \"targets\": [\n {\n \"datasource\": {\n \"type\": \"influxdb\",\n \"uid\": \"nnX4Q0D4z\"\n },\n \"groupBy\": [\n {\n \"params\": [\n \"10s\"\n ],\n \"type\": \"time\"\n },\n {\n \"params\": [\n \"none\"\n ],\n \"type\": \"fill\"\n }\n ],\n \"hide\": false,\n \"measurement\": \"sys\",\n \"orderByTime\": \"ASC\",\n \"policy\": \"default\",\n \"refId\": \"A\",\n \"resultFormat\": \"time_series\",\n \"select\": [\n [\n {\n \"params\": [\n \"free_heap\"\n ],\n \"type\": \"field\"\n },\n {\n \"params\": [],\n \"type\": \"last\"\n }\n ]\n ],\n \"tags\": [],\n \"query\": \"SELECT last(\\\"free_heap\\\") FROM \\\"sys\\\" WHERE $timeFilter fill(none)\",\n \"rawQuery\": true\n }\n ]\n}",
"mode": "code",
"code": {
"language": "json",
"showLineNumbers": true,
"showMiniMap": true
}
}
},
{
"id": 3,
"title": "Data from panel above",
"type": "table",
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"gridPos": {
"h": 7,
"w": 15,
"x": 0,
"y": 13
},
"options": {
"showTypeIcons": true
},
"targets": [
{
"datasource": {
"type": "datasource",
"uid": "-- Dashboard --"
},
"panelId": 2,
"withTransforms": true,
"refId": "A"
}
]
}
],
"schemaVersion": 37,
"title": "Debug: Last power ON state // 2023-01-30 23:04:12",
"tags": [
"debug",
"debug-stat"
],
"time": {
"from": "2023-01-02T21:04:12.563Z",
"to": "2023-01-30T21:04:12.563Z"
}
} Thank you for your response I have removed GROUP BY from query so I could put it into github as a comment, we don't need historical data anyway, now querry is grabbing the latest value from DB. So far doesn't affect anything, I can still display value in public dashboard but not it's timestamp Sorry, I'm not familiar with the chrome dev tools and how to check and compare request/response content And here is public dashboard URL just in case |
I was able to reproduce this error with this JSON |
Closing this issue since the |
What happened:
I'm trying to make a public dashboard where my neighbors can see if there is electricity in the building and when there is no electricity. Everything is ok except one moment: I would like to display the timestamp of the last value I've got from my sensor. I got it displaying on original grafana dashboard when I'm logged in, but it doesn't work on a public dashboard as anonymous user.
FYI: There is no problem when displaying the value itself by using this query, but when I'm selecting 'Time' in 'Fields' - I've got 'no data' displaying on the panel
how it's looking when I'm logged in (non public dashboard view)
and this is what I got when seeing it as public dashboard
Environment:
The text was updated successfully, but these errors were encountered: