grafana / mimir

Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.
https://grafana.com/oss/mimir/
GNU Affero General Public License v3.0
3.98k stars 503 forks source link

Mimir tool analyze support mimir query logs trough grafana #6620

Open jmichalek132 opened 9 months ago

jmichalek132 commented 9 months ago

Is your feature request related to a problem? Please describe.

Mimirtool currently provides commands to analyze rule files, and the Mimir ruler, and the dashboards. But it misses what metrics were queried for e.g. using the explore page.

Describe the solution you'd like

Mimir can optionally log all queries, these logs could be queried and analysed using the mimirtool.

pracucci commented 9 months ago

Mimir can optionally log all queries

A clarification just to be on the same page. Mimir already supports logging all queries in the query-frontend. It's enabled by default and can be disabled setting -query-frontend.query-stats-enabled=false. The query logs can be found looking for "query stats".

these logs could be queried and analysed using the mimirtool

I agree having a logs analysis command may be useful. Not sure about having mimirtool querying logs directly, since logs may be stored in a variety of backends.

jmichalek132 commented 9 months ago

Mimir can optionally log all queries

A clarification just to be on the same page. Mimir already supports logging all queries in the query-frontend. It's enabled by default and can be disabled setting -query-frontend.query-stats-enabled=false. The query logs can be found looking for "query stats".

these logs could be queried and analysed using the mimirtool

I agree having a logs analysis command may be useful. Not sure about having mimirtool querying logs directly, since logs may be stored in a variety of backends.

Definitely agree, I was thinking of querying the logs trough Grafana API, and not loki directly, but yes even with that this feature might not work for everyone, but I am willing to work on contributing it if it would be accepted.