Continuous Query Problem

Hello everyone!, I have a telegraf/influxdb/grafana configuration and all the raw data received from telegraf is stored in a database called db1. I created a continuous query to write downsampled data (one point every 10 minutes) in other database (db2), my CQ is like this:

CREATE CONTINUOUS QUERY “cq_10min” ON “db1” BEGIN SELECT mean( * ) INTO db2.autogen.:MEASUREMENT FROM /./ GROUP BY time(10m), END

All the MEASUREMENT names are called the same that in db1, but the field names has changed. For example:
In the measurement cpu, what in db1 is called usage_idle, in db2 now is called mean_usage_idle.

Is there any way to remain the same field names? This is a problem for me since a want to create grafana templates that will allow me to change between databases.
What could be other solution for this kind of issues?

Thanks in advance!

Fer Rios

@ferztyle That is not possible currently. I would advise not downsampling. Are you running into performance issues? How many hosts are you monitoring?

Hi, sorry for the delay!. Currently i have like 50 hosts monitored, and the goal is to put 100 more. We make use of many telegraf input plugins like jolokia, apache, haproxy, sqlserver, win_perf, processes, postgresql, snmp, etc, and those plugins comes with tons of data!. I’m interested on the downsampling part because i want to be able to perform queries from the grafana on this measurements to retrieve the oldest data ( like now() - 1 year ago).

If I had exactly the same names as the original measurement, i would be able to perform queries from the grafana much more easily.

PD: I found the same problem here too!: https://github.com/influxdata/influxdb/issues/8524

Fer Rios

@ferztyle This is an issue we are very aware of and plan to fix in upcoming releases. It is decidedly non trivial however. My advice would be to pick the queries that you need to downsample for the long term analysis and leave the rest of the data undownsampled.

Ok @jackzampolin , thanks for your help.