aws-samples / aws-samples/aws-iot-fleetwise-evbatterymonitoring

Performance Issue w/ Grafana Timestream Queries After DB Records Exceeds Large Amount

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8
Forks
7
PR merge metrics
No merged PRs in 30d

Description

When testing the Grafana dashboard for the ev battery monitoring demo, I ran into a new issue where Grafana would hang indefinitely when trying to load the provided sample dashboard.

After investigating, I found that the ‘Name of Signal’ variable was using a query which broke once the Timestream data exceeded a large quantity of records (900,000+ in my db).

The original provided variable query was doing a select on all measure_name entries from all time and this was not resolving even when i tried directly in the query editor without timing out.

I was able to fix it by replacing the query with a distinct call instead:
```
SELECT distinct(measure_name) from "FleetWiseDatabase"."FleetWiseTable"
```

Screenshots of the issue/resolution in Grafana:

Before:

![image](https://github.com/aws-samples/aws-iot-fleetwise-evbatterymonitoring/assets/24458226/e5046ef6-ca69-4958-afc6-ec34d48d3fe7)

After:

![image](https://github.com/aws-samples/aws-iot-fleetwise-evbatterymonitoring/assets/24458226/32bdec20-b13c-453a-a41b-fcb5133fcd97)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.