osisoftpi-grafana
osisoftpi-grafana copied to clipboard
Variables not working after upgrading to 5.1.0
We've just upgraded the plugin on our server, and now almost all the dashboards are broken.
While trying to fix the issues, I discovered that the syntax has changed. Previously, we could use $variable, but now it seems we need to use ${variable}
However, this syntax doesn't work for attributes, only elements. For example:
This works: mypiafserver\${database}\${element}\child element ${somevariable};attribute x
This doesn't work: mypiafserver\${database}\${element}\child element ${somevariable};attribute ${attributevariable}
This also doesn't work: mypiafserver\${database}\${element}\child element ${somevariable};${attributevariable}
Is it a bug or something that we can fix/adjust? Also, is there a quick way to fix all the dashboards to adjust them to the new syntax or I will have to go one by one?
Obs: We are using the plugin to connect to the AF Server. I recall that someone else encountered a similar issue related to PI Point, which might be the same problem or a different one.
variables should work on both element as attribute. how there are some limitations regarding usage of the All or Mult select.
can you use Grafana query inspector and past the real call here?
Just tested with version 5.1.0 final and it works.
Hi @pvmagacho-nde, I have prepared a simple test scenario where I configured a panel with 01 variable representing the ${database} which in this example is 'Configuration' and another variable ${attribute} representing part of the name of the attribute, in this example 'Mode'.
Please check below the query inspection, some information such as webids I have masked but they are not relevant. Also our Grafana version is Grafana v10.4.2 (22809dea50), I wonder if the bug is related to our version.
{ "request": { "url": "api/ds/query?ds_type=gridprotectionalliance-osisoftpi-datasource&requestId=Q228", "method": "POST", "data": { "queries": [ { "enableStreaming": { "enable": false }, "target": "AFserver\\Configuration\\OSIsoft\\PI Web API\\PIWeb\\System Configuration;DebugMode", "elementPath": "AFserver\\Configuration\\OSIsoft\\PI Web API\\PIWeb\\System Configuration", "attributes": [ { "label": "Debug${attribute}", "value": { "value": "Debug${attribute}", "expandable": false } } ], "segments": [ { "label": "AFserver", "value": { "expandable": true, "value": "AFserver" } }, { "label": "Configuration", "value": { "expandable": true, "value": "Configuration", "webId": "F1RDxxx" } }, { "label": "OSIsoft", "value": { "expandable": true, "value": "OSIsoft", "webId": "F1Emxxx" } }, { "label": "PI Web API", "value": { "expandable": true, "value": "PI Web API", "webId": "F1Emxxx" } }, { "label": "PIWeb", "value": { "expandable": true, "value": "PIWeb", "webId": "F1Emxxx" } }, { "label": "System Configuration", "value": { "expandable": false, "value": "System Configuration", "webId": "F1Emxxx" } } ], "isAnnotation": false, "refId": "A", "interpolate": { "enable": false, "interval": "" }, "useLastValue": { "enable": false }, "useUnit": { "enable": false }, "recordedValues": { "enable": false, "interval": "" }, "digitalStates": { "enable": false }, "webid": "", "regex": { "enable": false }, "expression": "", "summary": { "basis": "EventWeighted", "interval": "", "nodata": "Null", "types": [] }, "startTime": "2024-01-01T03:00:00.000Z", "endTime": "2025-01-01T02:59:59.999Z", "isPiPoint": false, "scopedVars": { "__interval": { "text": "6h", "value": "6h" }, "__interval_ms": { "text": "21600000", "value": 21600000 } }, "datasource": { "type": "gridprotectionalliance-osisoftpi-datasource", "uid": "vdH2rl4Iz" }, "datasourceId": 23, "intervalMs": 21600000, "maxDataPoints": 1336 } ], "from": "1704078000000", "to": "1735700399999" }, "hideFromInspector": false }, "response": { "results": { "A": { "error": "api error 404 - The specified path was not found. If more details are needed, please contact your PI Web API administrator for help in enabling debug mode.", "errorSource": "", "status": 500, "frames": [], "refId": "A" } } } }
Hi @pvmagacho-nde,
Just checking, did you get my last reply?
We have nowhere else to seek for assistance.
Hello. The usage of more than one variable in the query is not 100% supported. How is the panel configured? Are you using panel repeat?
Hello. The usage of more than one variable in the query is not 100% supported. How is the panel configured? Are you using panel repeat?
Hi @pvmagacho-nde, Yes, we are using panel repeat but also doesn't work without panel repeat.
Funny thing that it worked flawlessly with version 4.x.x, comparing the changes on code I can see that lot has changed on files datasource.ts, helper.ts, types.ts and so on.
Closing this. Using more than one variable to show multiple lines in one visualization is not yet supported. Closing this.