grafana / timestream-datasource

Amazon Timestream in Grafana
https://grafana.com/grafana/plugins/grafana-timestream-datasource
Apache License 2.0
24 stars 19 forks source link

Getting duplicate legends in Grafana when using selecting for a particular measure_name #161

Closed flycast closed 2 years ago

flycast commented 2 years ago

What happened: I have data with multiple measurements in AWS Timestream. When I use the following query I get multiple data legends: SELECT * FROM "sampleDB"."LgFlaminator" where measure_name = 'PolyPressure'

image

What you expected to happen: I expected that I would get a single data series with a single legend. I find that I have to call the query like this to get the result I wanted: SELECT time, measure_value::double FROM "sampleDB"."LgFlaminator" where measure_name = 'PolyPressure'

image

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

Example:

  1. Add multiple data points for two different measurement names to Timestream.
  2. Create query

Anything else we need to know?:

Environment:

sarahzinger commented 2 years ago

@flycast I see 2 markers like that when the table I'm trying to query has 2 numeric columns, perhaps if you switch to a table view, you'll see something similar that could explain what is going on:

Screen Shot 2022-04-18 at 1 58 56 PM

In the case above, AWS is returning back to us 2 columns that I believe can be the same value in different formats for the same measurement (although interestingly in this sample dataset, one of the columns is always empty)

The visualization does not know which column you would like to render and so it renders both. As you point out you can use sql syntax to narrow down to render just the fields you are interested in.

I believe this is as designed so I'll close the issue, but if I'm misunderstanding something let me know and I'm happy to reopen it!