Parse error : input size too long (xxxx> 5120)

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

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

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