grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
64.04k stars 11.99k forks source link

Elasticsearch: In Explore we add unnecessary `date_histogram` aggregation when requesting logs #68734

Open fmassot opened 1 year ago

fmassot commented 1 year ago

What went wrong?

What happened:

On the explore view, when I sent a request of query type "logs", the backend builds a query with a date_histogram aggregation. This aggregation is useless because the frontend is also firing a logs volume request.

What did you expect to happen:

The backend does not need to build a logs query with a date_histogram aggregation. This means that we can remove all those lines

How do we reproduce it?

What Grafana version are you using?

10.1.0-116348pre-ubuntu

Optional Questions:

Is the bug inside a Dashboard Panel?

No response

Grafana Platform?

Docker

User's OS?

macOS Monterey

User's Browser?

Google Chrome Version 112.0.5615.137 (Official Build) (arm64)

Is this a Regression?

None

Are Datasources involved?

Elasticsearch

Anything else to add?

No response

ivanahuckova commented 1 year ago

Thank you for creating this. You are right, but the possible issue in removing this is in dashboard queries - because there you can use time series panel to display this data. So this might be breaking change. We need to think this trough because there are couple of different options on how to solve this:

So at this point, we won't accept PRs tackling this as we need to reach consensus within the squad on what we want to do.