-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
staleA stale issue or PR that will automatically be closed.A stale issue or PR that will automatically be closed.
Metadata
Metadata
Assignees
Labels
staleA stale issue or PR that will automatically be closed.A stale issue or PR that will automatically be closed.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
cyriltovena commentedon Jun 22, 2020
You can change it in Grafana in the datasource section of Loki.
If you use logcli it's a simple flag. If you use the API it's a query string
limits
.Hope this helps.
yangvipguang commentedon Jun 23, 2020
thanks,I have solved it. But if you set more than 5000 lines。The log query page will report an error。

adityacs commentedon Jun 23, 2020
@yangvipguang You can change the
max_entries_limit_per_query
value in Loki's limits_configyangvipguang commentedon Jun 23, 2020
Ok,I think so. But before I do't find the setting in the limits_config configuration of document. I will try. Thanks
stale commentedon Jul 23, 2020
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
yongzhang commentedon May 13, 2021
I'm a bit confused about this:
the default value of
max_entries_limit_per_query
is 5000 as documented here https://grafana.com/docs/loki/latest/configuration/#limits_config,but why I still get 1000 limit in grafana explore?
yongzhang commentedon May 13, 2021
^ ah I found it in datasource settings.
rufreakde commentedon Apr 6, 2022
Could you share your knowledge as to how you found the datasource settings.
And also how you edited it to change the limit. So others finding this thread in the future may directly see your findings.
yongzhang commentedon Apr 6, 2022
^ change the max lines above
karuthevarbiokey commentedon Nov 9, 2022
Regardless of what value i set for max_entries_limit_per_query in values.yaml, i see that loki pod always defaults it to 5000. I tried with new installation, with upgrades, etc, it still defaults to 5000.
ryanth2022 commentedon Nov 16, 2022
@yongzhang the configuration to increase max lines for loki datasource will be like below
https://grafana.com/docs/grafana/latest/datasources/loki/
9k001 commentedon Dec 20, 2023
Me, too. How did you solve this problem?
dodream28 commentedon May 12, 2025
To increase the maximum number of entries returned per query in Grafana when using Loki, you'll need to modify the max_entries_limit_per_query parameter in your Loki configuration file (loki-config.yaml or similar).
By default, this value is set to 5000, which means any query in Grafana will only return up to 5,000 log entries unless specified otherwise. To raise this limit, you can set it up to a maximum of 50000.
Here’s how to update your Loki config:
Make sure this setting is under the limits_config section. After updating the config file, restart your Loki instance to apply the changes.
For more details, you can refer to the official Loki configuration documentation:
🔗 https://grafana.com/docs/loki/latest/configure/
Let me know if you'd like help formatting the config file or troubleshooting the change.