Loki LogQL log count graphing doesn't work

When I try to create a dashboard graph with: rate(({app_kubernetes_io_name="nginx"} |= "ERROR")[10s]) and I look at the query inspector, I get: legacy endpoints only support streams result type, current type is matrix. Should this work with Graphana yet? The loki docs have this feature documented here: https://github.com/grafana/loki/blob/master/docs/logql.md#range-vector-aggregation

Ok, it seems like all that is needed is to open a Prometheus datasource and add /loki to the loki endpoint used for the logs, and then it works!

1 Like

I tried the same, however, when I am trying to run some query in the explore page, it always says “loading metrics…”, hence not able to run any query successfully.

Anyone has the same issue?

image

1 Like

I am in the same state.
I cannot execute a query on the explore page.
However, the panel query can be executed and the graph is displayed.
This may be caused by registering Loki as Prometheus, but I do not know how to solve it.