influxdata / influxdata/kapacitor

Google Hangouts Chat integration - HTTP/Post issue

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

Hi, im trying to send alerts to a google chat room using a webhook URL generated for the chatroom using HTTP/Post since kapacitor does not natively support Google Hangouts as an endpoint handler like grafana does. I am not able to get anything across, if someone has a clue or has had to deal with a similar situation, i would appreciate feedback. Also, maybe you guys could look into implementing Google chats as a handler in chronograf like grafana, thanks !

Here is the TICKScript:
var db = 'telegraf'

var rp = 'autogen'

var measurement = 'mem'

var groupBy = []

var whereFilter = lambda: ("host" == 'Proxmox')

var name = 'Memory Alert'

var idVar = name

var message = ' {{.ID}} is {{.Level}} value: {{ index .Fields "value" }}'

var idTag = 'alertID'

var levelTag = 'level'

var messageField = 'message'

var durationField = 'duration'

var outputDB = 'chronograf'

var outputRP = 'autogen'

var outputMeasurement = 'alerts'

var triggerType = 'threshold'

var crit = 1

var data = stream
|from()
.database(db)
.retentionPolicy(rp)
.measurement(measurement)
.groupBy(groupBy)
.where(whereFilter)
|eval(lambda: "used")
.as('value')

var trigger = data
|alert()
.crit(lambda: "value" > crit)
.message(message)
.id(idVar)
.idTag(idTag)
.levelTag(levelTag)
.messageField(messageField)
.durationField(durationField)
.post('https://chat.googleapis.com/v1/spaces/AAAAi4UyLxA/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=2uf24LgaUpWc5esVflh52DzwGTbYjZdRTzuWMz-rhRE%3D')
.header('Content-Type', 'application/json')
trigger
|eval(lambda: float("value"))
.as('value')
.keep()
|influxDBOut()
.create()
.database(outputDB)
.retentionPolicy(outputRP)
.measurement(outputMeasurement)
.tag('alertName', name)
.tag('triggerType', triggerType)

trigger
|httpOut('output')

Contributor guide

Open the contributing guide

Research direction

The issue provides a TICKScript using alert().post() and asks for help sending alerts to Google Hangouts Chat, plus a possible native handler. No repository files, tests, or concrete implementation target are identified; first clarify whether the goal is fixing HTTP/Post configuration or adding a handler, then define reproduction and acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Domain
api, backend, observability-sre
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.