-
Notifications
You must be signed in to change notification settings - Fork 8
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
Failed to fetch query data when a template variable of assets was selected as multiple items or 'All' #178
Comments
Hi @nyamad Thanks for reporting this! I've been able to reproduce something similar; however, I'm getting back some data in all of the panels (even though it's the same number - so there's definitely a bug there, but maybe a different one). To help us in debugging this, can you please paste (or attach a file with) the payload for your requests to |
Hello @idastambuk san, Thank you for your confirmation and message. I've captured payloads of requests as follows. Selecting Asset-A and Asset-B For first panel: {
"queries": [
{
"assetIds": [
"f619580e-5d3a-43df-9644-9ad496c96cdf",
"d8de088e-e659-4fad-9eda-702ff11aaf18"
],
"datasource": {
"type": "grafana-iot-sitewise-datasource",
"uid": "ad22b52d-1bf0-4574-a0a9-a5a26d112c86"
},
"maxPageAggregations": 1,
"propertyId": "7a33a814-5cb3-4a43-a85c-f2b2fb0269c6",
"queryType": "PropertyValue",
"refId": "A",
"propertyAlias": "",
"region": "",
"datasourceId": 18,
"intervalMs": 20000,
"maxDataPoints": 940
}
],
"range": {
"from": "2023-05-01T03:43:13.852Z",
"to": "2023-05-01T09:43:13.852Z",
"raw": {
"from": "now-6h",
"to": "now"
}
},
"from": "1682912593852",
"to": "1682934193852"
} For second panel: {
"queries": [
{
"assetIds": [
"f619580e-5d3a-43df-9644-9ad496c96cdf",
"d8de088e-e659-4fad-9eda-702ff11aaf18"
],
"datasource": {
"type": "grafana-iot-sitewise-datasource",
"uid": "ad22b52d-1bf0-4574-a0a9-a5a26d112c86"
},
"maxPageAggregations": 1,
"propertyId": "7a33a814-5cb3-4a43-a85c-f2b2fb0269c6",
"queryType": "PropertyValue",
"refId": "A",
"propertyAlias": "",
"region": "",
"datasourceId": 18,
"intervalMs": 20000,
"maxDataPoints": 940
}
],
"range": {
"from": "2023-05-01T03:43:13.911Z",
"to": "2023-05-01T09:43:13.912Z",
"raw": {
"from": "now-6h",
"to": "now"
}
},
"from": "1682912593911",
"to": "1682934193912"
} Selecting 'All' {
"queries": [
{
"assetIds": [
"$__all"
],
"datasource": {
"type": "grafana-iot-sitewise-datasource",
"uid": "ad22b52d-1bf0-4574-a0a9-a5a26d112c86"
},
"maxPageAggregations": 1,
"propertyId": "7a33a814-5cb3-4a43-a85c-f2b2fb0269c6",
"queryType": "PropertyValue",
"refId": "A",
"propertyAlias": "",
"region": "",
"datasourceId": 18,
"intervalMs": 20000,
"maxDataPoints": 940
}
],
"range": {
"from": "2023-05-01T03:57:22.682Z",
"to": "2023-05-01T09:57:22.682Z",
"raw": {
"from": "now-6h",
"to": "now"
}
},
"from": "1682913442682",
"to": "1682935042682"
} {
"queries": [
{
"assetIds": [
"$__all"
],
"datasource": {
"type": "grafana-iot-sitewise-datasource",
"uid": "ad22b52d-1bf0-4574-a0a9-a5a26d112c86"
},
"maxPageAggregations": 1,
"propertyId": "7a33a814-5cb3-4a43-a85c-f2b2fb0269c6",
"queryType": "PropertyValue",
"refId": "A",
"propertyAlias": "",
"region": "",
"datasourceId": 18,
"intervalMs": 20000,
"maxDataPoints": 940
}
],
"range": {
"from": "2023-05-01T03:57:22.731Z",
"to": "2023-05-01T09:57:22.732Z",
"raw": {
"from": "now-6h",
"to": "now"
}
},
"from": "1682913442731",
"to": "1682935042732"
} (FYR) Selecting only Asset-A {
"queries": [
{
"assetIds": [
"f619580e-5d3a-43df-9644-9ad496c96cdf"
],
"datasource": {
"type": "grafana-iot-sitewise-datasource",
"uid": "ad22b52d-1bf0-4574-a0a9-a5a26d112c86"
},
"maxPageAggregations": 1,
"propertyId": "7a33a814-5cb3-4a43-a85c-f2b2fb0269c6",
"queryType": "PropertyValue",
"refId": "A",
"propertyAlias": "",
"region": "",
"datasourceId": 18,
"intervalMs": 10000,
"maxDataPoints": 1888
}
],
"range": {
"from": "2023-05-01T03:56:00.193Z",
"to": "2023-05-01T09:56:00.193Z",
"raw": {
"from": "now-6h",
"to": "now"
}
},
"from": "1682913360193",
"to": "1682934960193"
} I hope these would be helpful. If more information is needed, please ask me again. |
Hi @nyamad thanks a lot, that helps! We will add it to our backlog. For anyone that picks this up: it seems like the assetId fields in all queries are the same - an array of both. I would expect them to be iterated by panels, so that each panel gets its own assetId to query. Not sure how this feature works exactly though, and if the plugin or grafana is in charge of iterating over the variables. |
I have exactly the same issue Any progress or workaround for it ? |
What happened:
I have dashboards depending on template variables which store list of multiple assets of SiteWise for repeating panels.
For plugin version 1.7.0 or 1.8.0, if the variable's Multi-value or All option was enabled and I used them, panels did not render correct values due to the query data issue.
What you expected to happen:
Same as behavior as plugin version 1.5.1 (see screenshots)
How to reproduce it (as minimally and precisely as possible):
Example model
with any property likefoo
Example model
, likeAsset-A
andAsset-B
.foo
.assets
using a SiteWise datasource, then select List assets in the Query type field andExample model
in the Model ID field. Then check both of Multi-value and Include All option options, and click Apply.${assets}
as Assetfoo
as Propertyassets
as Repeat by variablefoo
as Fields in Value Options sectionassets
variable dropdown on the dashboard:Asset-A
-> The panel was rendered as expected.Asset-A
andAsset-B
-> Two panels were rendered, but values of them are not correct (shown as 'No data').Screenshots
Plugin version 1.8.0:
Plugin version 1.5.1 (expected behavior)
Anything else we need to know?:
Environment:
Thanks in advance,
The text was updated successfully, but these errors were encountered: