influxdata / influxdata/kapacitor
New tags from eval() node are not available in alert()
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
The following TICK script does not work as expected because the new `foo` tag is not seen by the `alert()` node so the alert id is the empty string:
```
batch
|query('select ... as value from ...')
...
.groupBy('host')
|eval(lambda: ...)
.as('foo')
.tags('foo')
.keep('value')
|alert()
.id('{{ index .Tags "foo" }}')
...
```
OTOH, adding a dummy `groupBy()` node makes the `foo` tag available and the alert id is now correct:
```
batch
|query('select ... as value from ...')
...
.groupBy('host')
|eval(lambda: ...)
.as('foo')
.tags('foo')
.keep('value')
|groupBy('host', 'foo')
|alert()
.id('{{ index .Tags "foo" }}')
...
```
This has been seen with Kapacitor 1.5.0.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the TICK script from the issue in Kapacitor 1.5.0, comparing the eval-to-alert pipeline with and without the extra groupBy('host', 'foo') node. Trace how eval().tags('foo') and alert() access tags, then verify that the alert id contains foo without the dummy groupBy node.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100