How to query the sum of the mean in InfluxDB?




  • I have an in-memory distributed storage system which contains more than 100 instances
  • I would like to monitor the overall memory usage
  • Telegraf will write the metrics to InfluxDB every 10s, but there may have sometimes Telegraf writes to InfluxDB timeout (very few and acceptable).

The proposed query looks like:

SELECT SUM(MEAN(used)) FROM “telegraf”.“autogen”.“mem” WHERE $timeFilter GROUP BY time($interval) fill(null)

But this is a syntax error because SUM needs to have a field parameter.



Should be something like SUM(used.mean)…this Will work if you are reporting the mean, and its an existing field.
If not you should calculate the field and then query the sum of those mean as SUM(used_mean)