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

Query often fails when using a property alias #335

Open
hwandersman opened this issue Jun 28, 2024 · 3 comments
Open

Query often fails when using a property alias #335

hwandersman opened this issue Jun 28, 2024 · 3 comments
Labels
datasource/Sitewise type/bug Something isn't working

Comments

@hwandersman
Copy link
Collaborator

What happened:
Calling Get Property Value History, Get Interpolated Property Values, and Get Property Value Aggregates often fails with a 500 when the query has a property alias specified (associated or disassociated).

When I edit an individual panel and refresh the query it will sometimes fetch data correctly. But 90% of the time it fails.

Info about this concept: https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html

What you expected to happen:
Data should be queried successfully when setting up a property history, interpolated, or aggregates query with a property alias used instead of an asset id.

How to reproduce it (as minimally and precisely as possible):

  1. Have an AWS account with a SiteWise data stream that has a data stream alias, and there is data ingested
  2. Add a Get Interpolated Property Values query to a panel in Grafana
  3. Specify a property alias for a property with data on the query
  4. See the query fail

Screenshots

image

Anything else we need to know?:

Environment:

  • Grafana version: 10.1.1
  • Plugin version: 1.22.1
  • OS Grafana is installed on: MacOS
  • User OS & Browser: Sonoma 14.5, Chrome
  • Others: Self Managed Grafana environment
@hwandersman hwandersman added type/bug Something isn't working datasource/Sitewise labels Jun 28, 2024
@idastambuk
Copy link
Contributor

Hi @hwandersman thanks for reporting this. I'm unfortunately unable to reproduce this either for associated or unassociated streams. Is there anything in the query options that could be relevant for reproducing this?

@hwandersman
Copy link
Collaborator Author

image

I use a property alias instead of an asset id and property id in the query.
I have set up a dashboard with multiple queries with associated and disassociated data streams and I have issues consistently showing data for all of them. I can sometimes show data for individual panels when editing them.

@sarahzinger
Copy link
Member

Hi @hwandersman is it only "get interpolated property values" or is it also "Get Property Value History", and "Get Property Value Aggregates" ?

It seems like get interpolated property values and get property value history are doing some kind of streaming-type behavior which I believe we added recently if I remember correctly? It seems possible something about that implementation could be faulty in certain circumstances? But that wouldn't explain getPropertyValueAggregates I don't think.

One thing I've noticed is that we make A LOT of requests if you have a lot of data right now. And we make them fairly quickly. See this video with the network tab:

aliasstreamingsmaller.mov

While it seems appropriate to stream data, I do feel like we're making a request to /query multiple times a second which seems like a good way to spam a server. I wonder if it's possible that depending on where it's deployed if it's possible we're hitting some kind of rate limiting error and the plugin doesn't handle it properly and throws a 500? I haven't been able to reproduce this, it's just a theory.

Perhaps the first action we could take for this ticket would be to add some kind of logging or return the error client. Other than that I'm not sure we have enough information to really take action. I'll put this into "next" to see if someone can take on double checking if there is anywhere we could improve error handling or add logging for these queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource/Sitewise type/bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants