influxdata / influxdata/kapacitor

TICK script cannot chain more than 2 derivative nodes in batch node

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

Description

**OS Version**
```
$ cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
```

**Kapacitor version**
```
$ kapacitor version
Kapacitor OSS 1.5.1 (git: HEAD 89828ffff6cf5cd4cb2b34bf883e134395f734de)
```

**Installed via rpm**
```
rpm -qa | grep kapacitor
kapacitor-1.5.1-1.x86_64
```

When I query the influxdb using `batch | query()` and then take the results of the data and perform chaining `|derivative()` methods. If I putting more than 2 derivative nodes it will stop outputting data.

**Writes data points back to InfluxDB**
```
batch
|query('''
SELECT
max("column1") AS column1,
max("column2") AS column2,
max("column3") AS column3,
.
.
.
FROM db.raw_data.measurement
''')
.period(1m)
.every(1m)
.groupBy(time(30s), 'column1', 'column2', 'column3')
|eval(lambda: int("column1")).as('column1').keep()
|eval(lambda: int("column2")).as('column2').keep()
|eval(lambda: int("column3")).as('column3').keep()
|derivative('column1').nonNegative().unit(30s).as('column1')
|derivative('column2').nonNegative().unit(30s).as('column2')
|influxDBOut()
.database('db')
.retentionPolicy('downsized')
.measurement('test')
.precision('ms')
```

**Does not write data back to InfluxDB**
```
batch
|query('''
SELECT
max("column1") AS column1,
max("column2") AS column2,
max("column3") AS column3,
.
.
.
FROM db.raw_data.measurement
''')
.period(1m)
.every(1m)
.groupBy(time(30s), 'column1', 'column2', 'column3')
|eval(lambda: int("column1")).as('column1').keep()
|eval(lambda: int("column2")).as('column2').keep()
|eval(lambda: int("column3")).as('column3').keep()
|derivative('column1').nonNegative().unit(30s).as('column1')
|derivative('column2').nonNegative().unit(30s).as('column2')
|derivative('column3').nonNegative().unit(30s).as('column3')
|influxDBOut()
.database('db')
.retentionPolicy('downsized')
.measurement('test')
.precision('ms')
```
Running `kapacitor show tick_script` shows that it processed data from the query but has `points_written="0"` for the `influxDBOut()`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied batch scripts on Kapacitor 1.5.1, comparing the two-derivative case with the three-derivative case and checking kapacitor show for points_written. Done means a batch node with three chained derivative nodes produces data and influxDBOut writes the resulting points.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.