Closed WMP closed 2 years ago
hi @WMP , i am trying to reproduce the problem, but i am not able to do so yet. it works fine for me.
if you remove the expression, so that you only have the query, does it work correctly in that case?
if it works, could you tell us the response-data? (you can get it by clicking the [query inspector] button, click [refresh] inside, then [expand all], and [copy to clipboard], and then you have it in your clipboard. please make sure to remove any private/secret info from the data.)
Hello, thanks for reply. Yes, works very good without expression math. When i do literally what you told, button copy to cliboard copy me Collapse data, so i copy it by mouse:
Object
request:Object
url:"api/ds/query"
method:"POST"
data:Object
queries:Array[2]
0:Object
hide:false
query:"SELECT mean("value") FROM "mqtt_consumer" WHERE ("topic" = 'supla/devices/zamel-mew-01-3a23c/channels/0/state/total_reverse_active_energy_balanced')"
rawQuery:true
refId:"A"
datasource:"InfluxDB"
datasourceId:1
intervalMs:15000
maxDataPoints:1446
1:Object
datasource:"__expr__"
expression:"$A - 1"
hide:false
refId:"B"
type:"math"
datasourceId:-100
range:Object
from:k
_isAMomentObject:true
_isUTC:false
_pf:Object
empty:false
unusedTokens:Array[0]
unusedInput:Array[0]
overflow:-2
charsLeftOver:0
nullInput:false
invalidEra:null
invalidMonth:null
invalidFormat:false
userInvalidated:false
iso:false
parsedDateParts:Array[0]
era:null
meridiem:null
rfc2822:false
weekdayMismatch:false
_locale:j
_calendar:Object
sameDay:"[Today at] LT"
nextDay:"[Tomorrow at] LT"
nextWeek:"dddd [at] LT"
lastDay:"[Yesterday at] LT"
lastWeek:"[Last] dddd [at] LT"
sameElse:"L"
_longDateFormat:Object
LTS:"HH:mm:ss"
LT:"HH:mm"
L:"DD/MM/YYYY"
LL:"D MMMM YYYY"
LLL:"D MMMM YYYY HH:mm"
LLLL:"dddd, D MMMM YYYY HH:mm"
_invalidDate:"Invalid date"
ordinal:function(e){…}
_dayOfMonthOrdinalParse:RegExp
_relativeTime:Object
future:"in %s"
past:"%s ago"
s:"a few seconds"
ss:"%d seconds"
m:"a minute"
mm:"%d minutes"
h:"an hour"
hh:"%d hours"
d:"a day"
dd:"%d days"
w:"a week"
ww:"%d weeks"
M:"a month"
MM:"%d months"
y:"a year"
yy:"%d years"
_months:Array[12]
0:"January"
1:"February"
2:"March"
3:"April"
4:"May"
5:"June"
6:"July"
7:"August"
8:"September"
9:"October"
10:"November"
11:"December"
_monthsShort:Array[12]
0:"Jan"
1:"Feb"
2:"Mar"
3:"Apr"
4:"May"
5:"Jun"
6:"Jul"
7:"Aug"
8:"Sep"
9:"Oct"
10:"Nov"
11:"Dec"
_week:Object
dow:1
doy:4
_weekdays:Array[7]
0:"Sunday"
1:"Monday"
2:"Tuesday"
3:"Wednesday"
4:"Thursday"
5:"Friday"
6:"Saturday"
_weekdaysMin:Array[7]
0:"Su"
1:"Mo"
2:"Tu"
3:"We"
4:"Th"
5:"Fr"
6:"Sa"
_weekdaysShort:Array[7]
0:"Sun"
1:"Mon"
2:"Tue"
3:"Wed"
4:"Thu"
5:"Fri"
6:"Sat"
_meridiemParse:RegExp
_abbr:"en-gb"
_config:Object
calendar:Object
sameDay:"[Today at] LT"
nextDay:"[Tomorrow at] LT"
nextWeek:"dddd [at] LT"
lastDay:"[Yesterday at] LT"
lastWeek:"[Last] dddd [at] LT"
sameElse:"L"
longDateFormat:Object
LTS:"HH:mm:ss"
LT:"HH:mm"
L:"DD/MM/YYYY"
LL:"D MMMM YYYY"
LLL:"D MMMM YYYY HH:mm"
LLLL:"dddd, D MMMM YYYY HH:mm"
invalidDate:"Invalid date"
ordinal:function(e){…}
dayOfMonthOrdinalParse:RegExp
relativeTime:Object
future:"in %s"
past:"%s ago"
s:"a few seconds"
ss:"%d seconds"
m:"a minute"
mm:"%d minutes"
h:"an hour"
hh:"%d hours"
d:"a day"
dd:"%d days"
w:"a week"
ww:"%d weeks"
M:"a month"
MM:"%d months"
y:"a year"
yy:"%d years"
months:Array[12]
0:"January"
1:"February"
2:"March"
3:"April"
4:"May"
5:"June"
6:"July"
7:"August"
8:"September"
9:"October"
10:"November"
11:"December"
monthsShort:Array[12]
0:"Jan"
1:"Feb"
2:"Mar"
3:"Apr"
4:"May"
5:"Jun"
6:"Jul"
7:"Aug"
8:"Sep"
9:"Oct"
10:"Nov"
11:"Dec"
week:Object
dow:1
doy:4
weekdays:Array[7]
0:"Sunday"
1:"Monday"
2:"Tuesday"
3:"Wednesday"
4:"Thursday"
5:"Friday"
6:"Saturday"
weekdaysMin:Array[7]
0:"Su"
1:"Mo"
2:"Tu"
3:"We"
4:"Th"
5:"Fr"
6:"Sa"
weekdaysShort:Array[7]
0:"Sun"
1:"Mon"
2:"Tue"
3:"Wed"
4:"Thu"
5:"Fri"
6:"Sat"
meridiemParse:RegExp
abbr:"en-gb"
_dayOfMonthOrdinalParseLenient:RegExp
_d:Date
_isValid:true
_z:null
to:k
_isAMomentObject:true
_isUTC:false
_pf:Object
empty:false
unusedTokens:Array[0]
unusedInput:Array[0]
overflow:-2
charsLeftOver:0
nullInput:false
invalidEra:null
invalidMonth:null
invalidFormat:false
userInvalidated:false
iso:false
parsedDateParts:Array[0]
era:null
meridiem:null
rfc2822:false
weekdayMismatch:false
_locale:j
_calendar:Object
sameDay:"[Today at] LT"
nextDay:"[Tomorrow at] LT"
nextWeek:"dddd [at] LT"
lastDay:"[Yesterday at] LT"
lastWeek:"[Last] dddd [at] LT"
sameElse:"L"
_longDateFormat:Object
LTS:"HH:mm:ss"
LT:"HH:mm"
L:"DD/MM/YYYY"
LL:"D MMMM YYYY"
LLL:"D MMMM YYYY HH:mm"
LLLL:"dddd, D MMMM YYYY HH:mm"
_invalidDate:"Invalid date"
ordinal:function(e){…}
_dayOfMonthOrdinalParse:RegExp
_relativeTime:Object
future:"in %s"
past:"%s ago"
s:"a few seconds"
ss:"%d seconds"
m:"a minute"
mm:"%d minutes"
h:"an hour"
hh:"%d hours"
d:"a day"
dd:"%d days"
w:"a week"
ww:"%d weeks"
M:"a month"
MM:"%d months"
y:"a year"
yy:"%d years"
_months:Array[12]
0:"January"
1:"February"
2:"March"
3:"April"
4:"May"
5:"June"
6:"July"
7:"August"
8:"September"
9:"October"
10:"November"
11:"December"
_monthsShort:Array[12]
0:"Jan"
1:"Feb"
2:"Mar"
3:"Apr"
4:"May"
5:"Jun"
6:"Jul"
7:"Aug"
8:"Sep"
9:"Oct"
10:"Nov"
11:"Dec"
_week:Object
dow:1
doy:4
_weekdays:Array[7]
0:"Sunday"
1:"Monday"
2:"Tuesday"
3:"Wednesday"
4:"Thursday"
5:"Friday"
6:"Saturday"
_weekdaysMin:Array[7]
0:"Su"
1:"Mo"
2:"Tu"
3:"We"
4:"Th"
5:"Fr"
6:"Sa"
_weekdaysShort:Array[7]
0:"Sun"
1:"Mon"
2:"Tue"
3:"Wed"
4:"Thu"
5:"Fri"
6:"Sat"
_meridiemParse:RegExp
_abbr:"en-gb"
_config:Object
calendar:Object
sameDay:"[Today at] LT"
nextDay:"[Tomorrow at] LT"
nextWeek:"dddd [at] LT"
lastDay:"[Yesterday at] LT"
lastWeek:"[Last] dddd [at] LT"
sameElse:"L"
longDateFormat:Object
LTS:"HH:mm:ss"
LT:"HH:mm"
L:"DD/MM/YYYY"
LL:"D MMMM YYYY"
LLL:"D MMMM YYYY HH:mm"
LLLL:"dddd, D MMMM YYYY HH:mm"
invalidDate:"Invalid date"
ordinal:function(e){…}
dayOfMonthOrdinalParse:RegExp
relativeTime:Object
future:"in %s"
past:"%s ago"
s:"a few seconds"
ss:"%d seconds"
m:"a minute"
mm:"%d minutes"
h:"an hour"
hh:"%d hours"
d:"a day"
dd:"%d days"
w:"a week"
ww:"%d weeks"
M:"a month"
MM:"%d months"
y:"a year"
yy:"%d years"
months:Array[12]
0:"January"
1:"February"
2:"March"
3:"April"
4:"May"
5:"June"
6:"July"
7:"August"
8:"September"
9:"October"
10:"November"
11:"December"
monthsShort:Array[12]
0:"Jan"
1:"Feb"
2:"Mar"
3:"Apr"
4:"May"
5:"Jun"
6:"Jul"
7:"Aug"
8:"Sep"
9:"Oct"
10:"Nov"
11:"Dec"
week:Object
dow:1
doy:4
weekdays:Array[7]
0:"Sunday"
1:"Monday"
2:"Tuesday"
3:"Wednesday"
4:"Thursday"
5:"Friday"
6:"Saturday"
weekdaysMin:Array[7]
0:"Su"
1:"Mo"
2:"Tu"
3:"We"
4:"Th"
5:"Fr"
6:"Sa"
weekdaysShort:Array[7]
0:"Sun"
1:"Mon"
2:"Tue"
3:"Wed"
4:"Thu"
5:"Fri"
6:"Sat"
meridiemParse:RegExp
abbr:"en-gb"
_dayOfMonthOrdinalParseLenient:RegExp
_d:Date
_isValid:true
_z:null
raw:Object
from:"now-6h"
to:"now"
from:"1628564797289"
to:"1628586397294"
hideFromInspector:false
response:Object
message:"expression request error"
Very bad formatting...
If you want, i can make you influxDB dump and send private.
And this same dashboard without Math:
@WMP thanks for the info!
one more thing: could you get me the query inspector data for the case without Math? it is enough to get the part starting at
> response
{
"request": {
"method": "GET",
"url": "api/datasources/proxy/1/query",
"params": {
"db": "telegraf",
"q": "SELECT mean(\"value\") FROM \"mqtt_consumer\" WHERE (\"topic\" = 'supla/devices/zamel-mew-01-3a23c/channels/0/state/total_reverse_active_energy_balanced')",
"epoch": "ms"
},
"data": null,
"precision": "ms",
"hideFromInspector": false
},
"response": {
"results": [
{
"statement_id": 0,
"series": [
{
"name": "mqtt_consumer",
"columns": [
"time",
"mean"
],
"values": [
[
0,
234.97671644676873
]
]
}
]
}
],
"executedQueryString": "SELECT mean(\"value\") FROM \"mqtt_consumer\" WHERE (\"topic\" = 'supla/devices/zamel-mew-01-3a23c/channels/0/state/total_reverse_active_energy_balanced')"
}
}```
I have this same on InfluxDB 2.0.8
hi @WMP , i tried to look into this problem more, but still haven't been able to find the problem. i have a couple recommendations:
8.1.0
, could you try upgrading to the newest in the 8.1.x
series? or, even better, to the newest version (8.2.x currently)? there were some fixes after 8.1.0
in parts that are touched by this issueWe've closed this issue since it needs more information and hasn't had any activity recently. We can re-open it after you you add more information. To avoid having your issue closed in the future, please read our CONTRIBUTING guidelines.
Happy graphing!
What happened: When i use Expression Math i have error: "failed to query data: type assertion to string failed" Logs:
What you expected to happen: I want to get result form simple math
How to reproduce it (as minimally and precisely as possible): My influxDB data:
Anything else we need to know?:
Environment:
Grafana version:8.1.0
Data source type & version:influxdb 1.8.1-1
OS Grafana is installed on: Ubuntu 20.04
User OS & Browser: Opera 75 on Ubuntu 20.04
Grafana plugins: agenty-flowcharting-panel @ 0.9.1 blackmirror1-singlestat-math-panel @ 1.1.8 fetzerch-sunandmoon-datasource @ 0.2.1 yesoreyeram-boomtable-panel @ 1.4.1
Others: