Need information about BUG #27374

We are seeing year 1970 in one of our custom dash board, please let us know how to resolve this issue

Grafana version we are using is V7.0.6[9f4a172a76]


image

You will probably need to give some more information, such as what your datasource is, what your visulization is, what your query is etc.

Hi Codlord,

My Datasource is MEMSQL, visualization is cluster events
Please find the dashboard JSON

{
“aliasColors”: {},
“bars”: true,
“dashLength”: 10,
“dashes”: false,
“decimals”: null,
“displayBarsSideBySide”: true,
“fieldConfig”: {
“defaults”: {
“custom”: {}
},
“overrides”: []
},
“fill”: 1,
“gridPos”: {
“h”: 6,
“w”: 8,
“x”: 16,
“y”: 13
},
“id”: 34,
“interval”: “”,
“labelAlign”: “left”,
“legend”: {
“alignAsTable”: true,
“avg”: false,
“current”: true,
“max”: false,
“min”: false,
“show”: true,
“total”: true,
“values”: true
},
“lines”: false,
“linewidth”: 1,
“links”: [],
“nullPointMode”: “null as zero”,
“percentage”: false,
“pointradius”: 3,
“points”: true,
“renderer”: “flot”,
“seriesOverrides”: [],
“spaceLength”: 10,
“stack”: true,
“steppedLine”: false,
“targets”: [
{
“alias”: “”,
“format”: “time_series”,
“rawSql”: “WITH t AS (\nSELECT *, lag(value) OVER w value_l, max(time_sec) OVER w time_sec_f\nFROM\n(SELECT\n max(time_sec) as time_sec,\n $_unixEpochGroup(time_sec, ‘$interval’) tg,\n max(value) as value,\n concat(trim_metric(name, 'memsql_event’), ’ {’, tags::$node, ’ ', tags::nodetype, '} ') as metric\nFROM metrics\nWHERE time_sec <= __unixEpochTo() and\n-- look back at least one interval to properly handle previous value\ntime_sec >= __unixEpochFrom() - ((__unixEpochTo()-$__unixEpochFrom())/10) \nand cluster = 'cluster'\nand extractor='memsql'\nand subsystem='event'\nand name like 'memsql_event_%'\ngroup by metric, tg\n) X\nWINDOW w AS (partition by metric order by time_sec)\n),\nt1 AS (\nselect time_sec, if(value >= ifnull(value_l, 0), value - ifnull(value_l, 0), value) value, metric, tg\nfrom t a\n-- strip datapoints from outside the window, as well as first result which is the starting value rather than rate\nwhere __unixEpochFilter(time_sec) and (time_sec > time_sec_f or time_sec_f >= __unixEpochFrom())),\ntf AS (\n-- temp table of 100 time groups over the selected time frame\nselect distinct __unixEpochGroup(time_sec, interval) as tg\nFROM (select (__unixEpochFrom() + (f-1) * ((__unixEpochTo()-__unixEpochFrom())/25)) as time_sec from ints where f > 0 and f <= 25) Y\n), \ntsf AS (\n-- join time groups with all found metrics\nselect distinct metric, tg \nfrom (select distinct metric from t1 where $__unixEpochFilter(time_sec) and value > 0) mf, tf\n)\n-- full outer join to fill in gaps over all time groups\nselect ifnull(t1.time_sec, tsf.tg) time_sec, t1.value, ifnull(t1.metric, tsf.metric) metric\nfrom t1 \nfull outer join tsf on tsf.metric = t1.metric and tsf.tg = t1.tg\norder by 3, 1”,
“refId”: “A”
}
],
“thresholds”: [],
“timeFrom”: null,
“timeShift”: null,
“title”: “cluster events (stacked)”,
“tooltip”: {
“shared”: true,
“sort”: 1,
“value_type”: “individual”
},
“type”: “corpglory-multibar-graph-panel”,
“xaxis”: {
“buckets”: null,
“customDateFormat”: “”,
“customDateFormatShow”: false,
“mode”: “time”,
“name”: null,
“show”: true,
“values”: []
},
“yaxes”: [
{
“decimals”: 0,
“format”: “time:YYYY-MM-DD HH:mm:ss”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: “0”,
“show”: true
},
{
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: false
}
],
“datasource”: null
}

I just run in the similar looking problem and lack of a solution.

Bildschirmfoto vom 2020-09-29 14-07-25

I recently started exploring InfluxDB and Grafana made my first dashboard and realized that the data I am collecting get cut while I query InfluxDB from within Grafana.
Here is what the Query Inspector replies:

Blockquote
{
“request”: {
“method”: “POST”,
“url”: “api/datasources/proxy/2/query”,
“params”: {
“db”: “playground”,
“epoch”: “ms”
},
“data”: “q=SELECT%20%22Emergency%20Stop%20activated%22%2C%20%22Machine%20on%22%20FROM%20%22Main%20Output%20Variables%22”,
“precision”: “ms”,
“hideFromInspector”: false
},
“response”: {
“results”: [
{
“statement_id”: 0,
“series”: [
{
“name”: “Main Output Variables”,
“columns”: [“time”, “Emergency Stop activated”, “Machine on”],
“values”: [
[1601, true, true],
[1601, true, true],
[1601, true, true],
[ … ]
]
}
]
}
],
“executedQueryString”: “SELECT "Emergency Stop activated", "Machine on" FROM "Main Output Variables"”
}
}

Attached is a snipet out of InfluxDB via terminal:
Bildschirmfoto vom 2020-09-29 14-06-34

As you can see the timestamp in the query is cut from 10 digits to 4 digits. therefor every line has the same time and i cannot get a proper visualization. My best guess is that we are missing a configuration anywhere.

Just realizing the offset of phanicloudde111’s and my timestamp of 5 hours 30 minutes. Converted to unixtime its some value between 19800 and 19859. Given the timestamp in phanicloudde111’s database is correct this might be a cut down to 5 digits. Probably the last 5 digits of unixtime.

My system setup is:
Debian 10
InfluxDB shell version 1.8.2
Grafana 7.2.0
All is running in the same VM.

I am looking forward for help.