influxdata / influxdata/kapacitor

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

Open
#2,685 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

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?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied Tickscript with the batch query, stats, httpOut, and alert nodes. Inspect the query results after the three-minute period and compare the emitted value across executions. Done means the cause of the retained measurement and growing emitted count is identified and the issue has a clear corrective scope.

Written by the indexing model from the issue text.

Assessment

Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.