influxdata / influxdata/kapacitor

PreviousLevel in a Lambda

Open
#2,751 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

I'm trying to write an alert where there is Critical, Warning, Info and OK. I'm running into an issue where the cpu usage will occasionally go between ok and info and i do not want to be alerted if that happens, but i do if it goes from warning down to info. It looks like there might be a way to get PreviousLevel (i've seen it here: https://github.com/influxdata/kapacitor/issues/2668 and https://github.com/influxdata/kapacitor/issues/2715 (where there looks to be "previousLevel" available.

I'm not seeing that in my data:
`{"Name":"","TaskName":"test-task","Group":"host=xxxxxx","Tags":{"host":"xxxxxx"},"ServerInfo":{"Hostname":"localhost","ClusterID":"xxxxxx","ServerID":"xxxxxx"},"ID":":host=xxxxxx","Fields":{"cpulist":"cpu0","status":"CHECK","timeframe":"30 minutes","used":0.16255418860727153},"Level":"INFO","Time":"2023-03-24T17:30:59.663545193-05:00","Duration":10797827655742,"Message":":host=xxxxxx is INFO"}`

is there a way to get previous level when using a batch query so i can put some extra logic in my info alert?

Contributor guide

Open the contributing guide

Research direction

Review the behavior discussed in issues #2668 and #2715, then trace how PreviousLevel or previousLevel is exposed to Lambda evaluations for batch queries. Confirm whether the requested previous alert level is available in the shown alert data; done means documenting or implementing a way to distinguish Warning-to-Info from OK-to-Info transitions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.