influxdata / influxdata/kapacitor
[Bug] Kapacitor Aggregate handler - interval option format
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
After kapacitor upgrade from 1.3.3 to 1.4 the interval option can't parse time.Duration format from a string.
In 1.3.3 this works fine
agg.yaml
```yaml
kind: aggregate
options:
interval: 1m
topic: alert_log
```
In 1.4 this wont work
agg yml
```yaml
topic: agg_topic
id: agg_handler
kind: aggregate
options:
interval: 1m
topic: alert_log
```
I get the error
```
failed to update handler: failed to decode options into *alert.AggregateHandlerConfig: 1 error(s) decoding:
* 'interval' expected type 'time.Duration', got unconvertible type 'string'
```
So had to change to
```yaml
topic: agg_topic
id: agg_handler
kind: aggregate
options:
interval: 60000000000
topic: alert_log
```
Contributor guide
Research direction
Locate AggregateHandlerConfig and the handler options decoding path, then reproduce the regression with the YAML examples in this issue. Verify that the human-readable interval value `1m` is accepted again while preserving the existing numeric form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100