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

Bytes metered in query stats in Timestream data source #106

Closed gadiraa closed 2 years ago

gadiraa commented 3 years ago

We were wondering if it is possible to easily add the bytes metered by a query to the query stats of a Grafana panel? Timestream’s query response has that information which is updated with every paginated call during query in progress and reaches a final value once the query execution finishes.

"QueryStatus": { "CumulativeBytesMetered": number, "CumulativeBytesScanned": number, "ProgressPercentage": number },

sudiptodas commented 3 years ago

Examples of how to access the necessary fields from query response: https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.run-query.html#code-samples.run-query.query-status. We'd like CumulativeBytesMetered displayed in a human-readable format. E.g., if a query read 102.5GB, then that is the human-readable message, instead of the raw value returned in the API which is in bytes.

sudiptodas commented 3 years ago

Screen Shot 2021-10-20 at 2 24 07 PM In the screen shot below, it will be good to add the bytes metered both in the detailed stats tab as well as the summary, e.g., "1 queries with total query time of 10.4s and XYZ MB bytes metered"

ryantxu commented 3 years ago

Ahh i see -- the data is currently returned in the metadata: image

but you want it showed in the stats panel too

sudiptodas commented 3 years ago

Yes, please, in the Stats view. That way its easier to discover for customers, and the value is more human readable.

farzadpanahi commented 2 years ago

It would be great if we could have both BytesMetered and BytesScanned. A quick way to see the bytes scanned for small queries and also to see how much AWS is overcharging us with their ridiculous 10MB round-up pricing policy!