Roopchand
Roopchand

Reputation: 39

Grafana error - parse error : input size too long (5491 > 5120)

I see the following error in our Grafana dashboard, which uses LOKI as a data source. Sometimes it shows the data, but other times it throws this error.

parse error : input size too long (XXX > 5120)

When I run the same query in Explorer, it works. What is this error, what does it mean ?

Upvotes: 2

Views: 1477

Answers (1)

Miguel N
Miguel N

Reputation: 43

I had the same issue! In my case it is related to the usage of the "All" option in the dashboard's variables.

For instance, image that we have a variable to allow the user to filter by container name and there are a lot of values for that variable. If the user selects the option “All”, the generated query will have a filter with all possible values.

Something like:

count_over_time({container_name=~"name1|name2|name3|...|nameX"} [$__range]})

Eventually, we hit the query length limit (5120 chars).

Grafana loki query translation example

The solution: In the dashboard variavels definiton, there is the option "Custom all value".

I have set that with: .+

So, when we select the value "All", the generated query become:

count_over_time({container_name=~".+"} [$__range]})

Upvotes: 2

Related Questions