influxdata / influxdata/kapacitor

sideload cannot be used when using deadman for scheduled maintenance

Open
#2,309 2 comments 2 reactions 2 assignees Claimed by @gunnaraasen View on GitHub
bug pm/review
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

Hi,
How do I use deadman in combination with sideload for doing scheduled maintenance? The problem is when using deadman after sideload, the added fields are no longer available for further processing as it uses [stats()](https://docs.influxdata.com/kapacitor/v1.5/nodes/eval_node/#deadman) [internally](https://github.com/influxdata/kapacitor/blob/e6bc51b8447de450c3f6fc0f6e47b6a0987ce5b6/pipeline/node.go#L280). So far the only way I've tried is to use the equivalent script describe in the docs
and insert sideload in between derivative and alert().

Regards,

Jeff

kapacitor version
Kapacitor OSS 1.5.4 (git: HEAD 1f648f85772efe222a3853fe1a0d9ef88854a8c1)

Given the ff:
```
stream
|from()
.database('telegraf')
.measurement('cpu')
|sideload()
.source('file:///data/scheduled-maintenance')
.order('hosts/{{.host}}.yml' , 'hostgroups/{{.hostgroup}}.yml')
.field('maintenance', FALSE)
.tag('testtag', 'testtag')
|deadman(0.0,20s, lambda: !"maintenance" )
```

Result: err="reference \"maintenance\" is missing value"

Equivalent script:
```
|derivative('emitted')
.unit(10s)
.nonNegative()
|sideload()
.source('file:///data/scheduled-maintenance')
.order('hosts/{{.host}}.yml', 'hostgroups/{{.hostgroup}}.yml')
.field('maintenance', FALSE)
.tag('testtag', 'testtest')
|alert()
.crit(lambda: !"maintenance" AND "emitted" <= 0)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.