kapacitor icon indicating copy to clipboard operation
kapacitor copied to clipboard

[HELP] It seems that tickscript makes data stay in cache

Open francescobianca opened this issue 2 years ago • 0 comments

Hi, I'm writing a script but I notice some peculiar behaviors:

var data = batch
    |query('''
    SELECT * FROM "my_db"."autogen"."measurements_id" WHERE "param1" = '...' AND "param2" = '...'
    ''')
        .period(3m)
        .every(20s)
    |log()
	|httpOut('query')

var trigger = data
    |stats(25s)
    |log()
    |httpOut('stats')
    |alert()
        .crit(lambda: "emitted" == 0.0)

If, when it starts, I don't have data for that measurement, it correctly makes an alert and closes it at the first measurement received, but once the period has passed (so I expect that the query has no results) it continues to visualize the last measurement. (I saw it by doing a get on the HttpOut endpoint)

In addition, the output of stats (emitted) grows at each execution

Where am I going wrong?

francescobianca avatar Mar 17 '22 15:03 francescobianca