Skip to content
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

Variables not working after upgrading to 5.1.0 #167

Open
davinishi opened this issue Oct 22, 2024 · 3 comments
Open

Variables not working after upgrading to 5.1.0 #167

davinishi opened this issue Oct 22, 2024 · 3 comments

Comments

@davinishi
Copy link

davinishi commented Oct 22, 2024

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.

@pvmagacho-nde
Copy link

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?

@pvmagacho-nde
Copy link

Just tested with version 5.1.0 final and it works.

@davinishi
Copy link
Author

davinishi commented Nov 1, 2024

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" } } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants