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
4.18k stars 537 forks source link

Mimir tool analyze support mimir query logs trough grafana #6620

Open jmichalek132 opened 1 year ago

jmichalek132 commented 1 year 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 1 year 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 1 year 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.