Optimize Geomap-Panel

Hi everyone :slight_smile:

I have a question regarding the optimization of my querys for the geomap panel.

  • First of all i am running a grafana cloud instance (version 8.5.2.) on my linux machine.
  • I want to query my data and visualize it with the gemap panel. The structure of my influxdb-bucket is the following:
  1. "example-bucket":
  2. _measurement: (saved as a variable inside grafana) list of sensors
  3. _tags=(‚Äústateofactive‚ÄĚ, ‚Äústateofbattery‚ÄĚ): 2 tags which show if the sensor is active and the battery percentage (are not really necessary for the geomap visualization)
  4. _field=(‚ÄúLongitude‚ÄĚ, ‚ÄúLatitude‚ÄĚ, ‚Äúsensorvalue‚ÄĚ): 3 fields which show long and lat as well as the measurement of the specific sensor
  • Right now i got everything visualized but it constantly get this error:

A query returned too many datapoints and the results have been truncated at 10171 points to prevent memory issues. At the current graph size, Grafana can only draw 1017.

My Query-Code is looking like this:

from(bucket: "RealDaten")
  |> range(start: -1d, stop: now())
  |> filter(fn: (r) => contains(value: r["_measurement"], set: ${Projects:json}))
  |> filter(fn: (r) => 
  r._field == "Latitude" or 
  r._field == "Longitude" or
  r._field == "sensorvalue")
  |> drop(columns:["_start", "_stop"])
  |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> group()
  |> yield(name: "max")
  |>  aggregateWindow(
      every: 1h,
      fn: mean,
      column: "sensorvalue",
      timeSrc: "_stop",
      timeDst: "_time",
      createEmpty: true
    )

But this still wont solve my problem therefore i also transformed my data with ‚ÄúFilter data by values‚ÄĚ so that i only get a specific area of my sensorvalues.

Is there any additional way to optimize my query so that i only get the data which is needed for my panel so that it wont crash ?

Thank you in advance :slight_smile: Greetings Grafu

You might want to ask your flux questions in https://community.influxdata.com/