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

[Request]: Ability to filter assets on Asset Name #154

Closed
taleena opened this issue Jan 20, 2023 · 2 comments · Fixed by #184
Closed

[Request]: Ability to filter assets on Asset Name #154

taleena opened this issue Jan 20, 2023 · 2 comments · Fixed by #184
Assignees
Labels

Comments

@taleena
Copy link
Collaborator

taleena commented Jan 20, 2023

Filing this on behalf of a feature request.

Based on the information provided on the plugin page, it looks like the assets are being pulled and identified by their ID numbers, which are randomly generated UUIDs. Therefore, users are unable to filter using visible Asset Name, rather than Asset IDs.

What are you really trying to do?
Filter specific assets using filters or regex that gets applied to visible Asset Name.

Context and constraints
This is an important issue and blocker for the user.

Describe what you've already tried and where it falls short

  1. Create IoT Sitewise assets
  2. Create Sitewise plugin
  3. Create dashboard
  4. Create variable in dashboard using Sitewise data source
  5. Select "List assets" query type (eg Asset 1, Asset 2, Asset 3)
  6. Input regex to attempt to filter the returned assets (eg only show Asset 2)
  7. See that this does not return the expected results as it is filtering on ID, not name

Example, if I have 4 assets:

A_ABC1_XYZ1
A_ABC1_XYZ2
B_ABC2_XYZ1
C_ABC1_XYZ1

Tried to pull only the last two specifically using the full names, (B_ABC2_XYZ1|C_ABC1_XYZ1), but the result returned was "None".

Additional context
The assumptions of the regex functionality: It should help filter data containing some constant info/schema. UUIDs are generated totally randomly, so this functionality does not work.
The user wants to filter their data on a constant field (such as asset name) rather than a random string such as the ID.

Environment

  • Grafana version: Amazon Managed Grafana v8.4.7
  • Data source version: SiteWise v1.4.1
  • OS Grafana is installed on:
  • User OS & Browser:
  • Product or feature area:
  • Impacted routes:
  • Others:
@taleena taleena added the enhancement New feature or request label Jan 20, 2023
@taleena taleena changed the title [Request]: [Request]: Ability to filter assets on Asset Name Jan 20, 2023
@sarahzinger sarahzinger added the type/bug Something isn't working label Mar 7, 2023
@sarahzinger
Copy link
Member

sarahzinger commented Mar 7, 2023

Just wanted to say I was able to recreate this. However I think this is more a bug with grafana than a sitewise feature.

I was able to use our test credentials which returned back an asset that looked something like this:

{ name: "Demo ..." id: "6edf..."}

when I then tried to use a template variable for that info and filter it with a regex, /De/ did not return any results in the preview value but /6e/ did which is confusing because the "Preview of values" returns the name of the value not the id

Screenshot 2023-03-07 at 1 59 11 PM
Screenshot 2023-03-07 at 1 59 22 PM

This feels like a fixable problem, although I'm not yet sure where the fix would go or what exactly it would look like. I did find this which appears to be the same issue for Azure.

I think it seems reasonable to keep this ticket open in this repo for now, although possibly whoever takes this issue might want to move it to main grafana. I might also recommend that included in this ticket is documenting a bit more the VariableEditor API so that future plugin developers can also learn how this functionality works for the future and what format data should be sent in for the regex to work properly, along with any limitations.

Editing to add that I also noticed that the way we're setting this variable editor is considered deprecated. I'm not sure if possibly upgrading could potentially solve this or if it would be a pre-requisite for fixing the underlying issue in core grafana.

Screenshot 2023-03-07 at 3 56 17 PM

@idastambuk
Copy link
Contributor

I had to revert the commit that closed this because it broke something variable interpolation. After some investigation, I would agree with @sarahzinger that it's a grafana issue, so I opened a feature request.
It's possible that variable work isn't under active development due to Scenes and this might be supported out of the box there, but I don't know much about it.

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

Successfully merging a pull request may close this issue.

4 participants