influxdata / influxdata/kapacitor

Add template variable for start time

Open
#1,252 0 comments 0 reactions 0 assignees View on GitHub
pm/core capability
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

Hello
Help me please, i have this issue and cant find way to solve it:
in deadman alert i need add time, when problem was detect. For example i have similar tickscript:
====
var data = stream
|from()
.database('telegraf')
.retentionPolicy('autogen')
.measurement('values')
|window()
.period(10s)
.every(10s)

data
|deadman(0.0, 10s)
.id('task `{{.TaskName}}`')
.message('''[{{.Level}}] Postbacks data is missing timeframe: *10s*, value: *{{ index .Fields }}*''')
.log('/var/log/kapacitor/mem_heartbeat_stream.log')
.slack()
=====

this script work fine and make alerts is log file. But i need add time, when problem was begin. I mean that in first time alert should be next:
"message('''[CRITICAL]. Postbacks data is missing timeframe: *10s*, value: *0*''')"
the second time alert:
"message('''[CRITICAL]. Postbacks data is missing timeframe: *20s*, value: *0*''')"
third time:
"message('''[CRITICAL]. Postbacks data is missing timeframe: *30s*, value: *0*''')"
etc.

but in every alert there is *10s* value

if its possible, explain please how to make this

Thanks

Contributor guide

Open the contributing guide

Research direction

Start with the deadman alert entry point and the template variables used by the shown TICKscript. Determine how alert state and elapsed time are represented across repeated alerts, then define the expected start-time variable and verify that the example messages expose increasing durations. No source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.