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

Long Execution Time of Flux Queries in Grafana with InfluxDB 2 #88015

Open
chamikarak opened this issue May 17, 2024 · 1 comment
Open

Long Execution Time of Flux Queries in Grafana with InfluxDB 2 #88015

chamikarak opened this issue May 17, 2024 · 1 comment
Labels
datasource/InfluxDB needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc

Comments

@chamikarak
Copy link

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

@tonypowa
Copy link
Contributor

hi @chamikarak
thank you for creating this issue

could you provide a a GitHub repository with a minimal setup that reproduces the issue?

Otherwise, please provide the following details and the team might be able to provide you with some guidance

  • Share some sanitized examples of the Flux queries that are running slowly
  • What is the approximate size of the datasets you are querying against (e.g., row count, series count)?

@tonypowa tonypowa added datasource/InfluxDB needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc labels Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource/InfluxDB needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc
Projects
None yet
Development

No branches or pull requests

2 participants