Error: A query returned too many datapoints and the results have been truncated

Hi,

I do not understand why I am seeing the following error when using Flux Query Language

Version
Grafana: v8.0.6
InfluxDB 2.0.8

Error:
A query returned too many datapoints and the results have been truncated at 15511 points to prevent memory issues. At the current graph size, Grafana can only draw 1551. Try using the aggregateWindow() function in your query to reduce the number of points returned.

Dashboard using Flux query language

I do not see this error when I used InfluxQL as language type

InfluxQL:
SELECT “Percent_Processor_Time” FROM “Processor” WHERE (“Site_ID” =~ /^$Site_ID$/ AND Environment =~ /^$Environment$/ AND instance = ‘_Total’) AND $timeFilter GROUP BY “Site_ID”

What am I missing?
One is Flux another is InfluxQL and it pulls equal number of datapoints, while flux throws this error InfluxQL does not.

Thanks
Ashish

Essentially the question is why max data points is getting applied for Flux but not for InfluxQL?
Is there a way to set “No Limit” for max data points?

Hey @nexplorer, I was facing the same issue and don’t want to make any changes in the task of Influxcloud, so what I did I just made some modifications in the query on Grafana that solved my issue by filtering the data by adding top command ( |> top(n: 400 ). May be this can help you too.
from(bucket: “${bucket}”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “abc”)
|> filter(fn: (r) => r[“_field”] == “xyz”)
|> top(n: 400)

1 Like

that helped … thanks

1 Like