2016-11-03 00:59:25 +00:00
|
|
|
package kapacitor
|
|
|
|
|
2016-11-03 19:21:17 +00:00
|
|
|
import "github.com/influxdata/chronograf"
|
2016-11-03 00:59:25 +00:00
|
|
|
|
|
|
|
// InfluxOut creates a kapacitor influxDBOut node to write alert data to Database, RP, Measurement.
|
|
|
|
func InfluxOut(rule chronograf.AlertRule) string {
|
2016-11-03 19:21:17 +00:00
|
|
|
return `
|
2016-11-03 00:59:25 +00:00
|
|
|
trigger
|
|
|
|
|influxDBOut()
|
|
|
|
.create()
|
|
|
|
.database(output_db)
|
|
|
|
.retentionPolicy(output_rp)
|
|
|
|
.measurement(output_mt)
|
2016-11-03 22:27:58 +00:00
|
|
|
.tag('alertName', name)
|
2016-11-03 19:21:17 +00:00
|
|
|
.tag('triggerType', triggerType)
|
|
|
|
`
|
2016-11-03 00:59:25 +00:00
|
|
|
}
|