How to put a max limit on the "line limit" in the grafana dashboard when the data source is Loki?

Hello, I want to configure grafana such that it prevents users from putting large number in the Line limit.


As you can see in the screenshot above, there is no such upper limit control in place and user can put any number in the box.

is there a configuration in grafana/grafana-ui to facilitate this behaviour?

Hey @saryani

You can limit the maximum number of lines returned by Loki within the Loki configuration.

max_entries_limit_per_query is the option you can configure. If the number of lines requested in Grafana is higher, the number of lines will be limited to what you configure in this max_entries_limit_per_query option.

thanks @dannykopping for the information.
as you mentioned this config belongs to loki and not grafana, now if I change the loki config is there a way for garafana to reflect this limit in its UI for I need to change it manually both in loki and grafana?

as you mentioned this config belongs to loki and not grafana , now if I change the loki config is there a way for garafana to reflect this limit in its UI

I don’t believe so, no. You’ll need to configure both to the same value.