influxdata / influxdata/kapacitor

Kapacitor alert templating

Open
#2,715 1 comment 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 am trying to use httppost to send alerts to elasticsearch. However, I am getting - "mapper parsing exception", I assume its because of time and _value in data.series.columns list.

This is the Alert format - `{"time":"2022-08-24T06:00:00Z","duration":0,"level":"OK","data":{"series":[{"name":"kpi","tags":{"BID":"1017","_field":"key-field","cid":"labec17-1017","version":"6.0"},"columns":["time","_value"],"values":[["2022-08-24T06:00:00Z","100"]]}]},"previousLevel":"CRITICAL","recoverable":true}` .

I want to remove time from "columns" array and similarily timestamp from "values" array. I found an answer in stackoverflow - https://stackoverflow.com/questions/47576251/what-language-do-kapacitors-alert-message-templates-use and tried to use alert template, however its not working. How can I do it?

Contributor guide

Open the contributing guide

Research direction

Start with the provided alert format, httppost output, and attempted alert template, then compare the result with Kapacitor's documented templating behavior. Reproduce the Elasticsearch mapper parsing exception and determine whether the template can omit the time column and timestamp value. Done means the generated alert payload has the requested shape and is accepted by Elasticsearch.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, go
Domain
observability, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.