Long Execution Time of Flux Queries in Grafana with InfluxDB 2 #88015
Labels
datasource/InfluxDB
needs more info
Issue needs more information, like query results, dashboard or panel json, grafana version etc
What happened?
When running Flux queries from Grafana to fetch data from InfluxDB 2, the query execution time exceeds 5 minutes. Even after optimizing the queries by removing regex parts from variable definitions and adding the duration parameter to the aggregateWindow function, the execution time remains high, with the best time achieved being 2 minutes.
What did you expect to happen?
I expected the Flux queries to execute within a reasonable time frame, ideally under 1 minute, considering the size and complexity of the data being queried.
Did this work before?
No, the queries have consistently taken a long time to execute, even before attempting the optimizations mentioned above.
How do we reproduce it?
1Use Grafana to run Flux queries against an InfluxDB 2 database.
Construct queries that involve fetching data over a significant time range or from large datasets.
Observe that the queries take longer than expected to execute, often exceeding 5 minutes.
Attempt optimizations such as removing regex parts from variable definitions and adding the duration parameter to the aggregateWindow function, but notice minimal improvements in query execution time.
Is the bug inside a dashboard panel?
Yes.
Environment (with versions)?
Grafana: 9.3.6
OS: windows
Browser: Chrome
Grafana platform?
Kubernetes
Datasource(s)?
InfluxDB2
The text was updated successfully, but these errors were encountered: