我想使用 influxDBOut 将警报消息存储在 influxDB 中。有可能吗?
这是我的刻度脚本
batch
|query('SELECT mean(value) as value FROM "metrics"."autogen"."__MEASUREMENT__"')
.period(15m)
.every(5s)
.groupBy(*)
.fill(0)
|alert()
.id('[METRICS] - {{ .Name }}')
.message('{{ .ID }} changed state to {{ .Level}} [{{ .Time }}] => The metric {{ index .Fields "value" }} in the last 15m.')
.info(lambda: TRUE)
.warn(lambda: "value" < __WARN_THRESHOLD__)
.crit(lambda: "value" < __CRIT_THRESHOLD__)
.stateChangesOnly()
.levelField('Severity')
|influxDBOut()
.database('alerts')
.retentionPolicy('autogen')
.measurement('__MEASUREMENT__')
.tag('Condition', 'Low')
提前谢谢你