Skip to content

query log with limit of 1000 #2226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yangvipguang opened this issue Jun 17, 2020 · 13 comments
Closed

query log with limit of 1000 #2226

yangvipguang opened this issue Jun 17, 2020 · 13 comments
Labels
stale A stale issue or PR that will automatically be closed.

Comments

@yangvipguang
Copy link

I want to know how to increase the number of limit for quering log 。Does it configure in configuration or some way to query the log with QL 。or it is hard-code in the code 。

@cyriltovena
Copy link
Contributor

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
Copy link
Author

thanks,I have solved it. But if you set more than 5000 lines。The log query page will report an error。
image

@adityacs
Copy link
Contributor

@yangvipguang You can change the max_entries_limit_per_query value in Loki's limits_config

@yangvipguang
Copy link
Author

Ok,I think so. But before I do't find the setting in the limits_config configuration of document. I will try. Thanks

@stale
Copy link

stale bot commented 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.

@stale stale bot added the stale A stale issue or PR that will automatically be closed. label Jul 23, 2020
@stale stale bot closed this as completed Jul 30, 2020
@yongzhang
Copy link

yongzhang commented 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?

image

@yongzhang
Copy link

^ ah I found it in datasource settings.

@rufreakde
Copy link

max_entries_limit_per_query

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
Copy link

yongzhang commented Apr 6, 2022

max_entries_limit_per_query

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.

image

^ change the max lines above

@karuthevarbiokey
Copy link

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
Copy link

@yongzhang the configuration to increase max lines for loki datasource will be like below
https://grafana.com/docs/grafana/latest/datasources/loki/

datasources:
  - name: Loki
    type: loki
    access: proxy
    url: http://localhost:3100
    basicAuth: true
    basicAuthUser: my_user
    jsonData:
      maxLines: 1000
      derivedFields:

@9k001
Copy link

9k001 commented Dec 20, 2023

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.

Me, too. How did you solve this problem?

@dodream28
Copy link

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.

Me, too. How did you solve this problem?

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:

limits_config:
  max_entries_limit_per_query: 50000

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale A stale issue or PR that will automatically be closed.
Projects
None yet
Development

No branches or pull requests

9 participants