I am trying to count the number of unique tags where this metric is coming from and I’ve got this query:
> SELECT count("last") AS heartbeat_count FROM (SELECT last("value") FROM
"mydb"."default"."service.heartbeat" WHERE deployment = 'mydeployment' AND time > now()-10m GROUP BY
"tag")
name: service.heartbeat
time heartbeat_count
---- ---------------
0 2
I get the correct output for “heartbeat_count” but since the timestamp is 0 I am unable to write the new metric back in via a continuous query. I’ve found a few pieces of information here and there that suggest the timestamp will default to “now()” but it does not appear to be the case for me.
> SELECT count("last") AS heartbeat_count INTO "mydb"."default"."service.health" FROM (SELECT last("value") FROM "mydb"."default"."service.heartbeat" WHERE deployment = 'mydeployment' GROUP BY "tag")
ERR: partial write: points beyond retention policy dropped=1
InfluxDB version: 1.3.7-c1.3.7
Any help would be greatly appreciated.