How to test and debug continuous query


I have a continuous query running on influx instance but it is not creating any measurements. How can i start debugging it ?..Logs doesn’t throw any errors either.

CREATE CONTINUOUS QUERY cq_fiveMin ON artifactory BEGIN SELECT sum(bytes) AS byte_sum, sum(“duration”) AS duration_sum, count(bytes) AS total_requests, distinct(clientip) AS distinct_clientip INTO test.two_weeks.fiveMin_rollups FROM test.two_weeks.requests GROUP BY repo, method, site, time(5m) fill(0) END.

My gut feeling is something’s not working with the distinct function

  1. Also query’s work without enclosing field_keys in double-quotes. so what’s the diff between enclosing field_keys in double-quotes and just field_keys?
  2. I want to find a distinct count of field_key over a period of time and later group it with time or some other field, how is that possible using continuous queries?

Any thoughts on this? Bump

Bump ! Bump ! Bump…

Any thoughts on this ?

Just to clarify: there are no results from this query? How are you searching for the measurements?

Nope.No results for the query. Can we use distinct function and INTO clause?..I remember looking at a Influx limitation that doesn’t allow distinct aggregation values to be stored into a new measurement

If we use DISTINCT with INTO there’s a possibility of points being overwritten. Let me look into this a little more and I will report back soon. Thanks for your patience!

Thank you for looking into this

It’s tough to debug CQs like this, and this is a complex query. Can you run this query manually (not as a continuous query) and get any results?

If you can run this manually, I would try pulling out the distinct to see if it works.