forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
influxdb_out.go
53 lines (49 loc) · 1.28 KB
/
influxdb_out.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package pipeline
// Writes the data to InfluxDB as it is received.
//
// Example:
// stream
// .eval(lambda: "errors" / "total")
// .as('error_percent')
// // Write the transformed data to InfluxDB
// .influxDBOut()
// .database('mydb')
// .retentionPolicy('myrp')
// .measurement('errors')
// .tag('kapacitor', 'true')
// .tag('version', '0.1')
//
type InfluxDBOutNode struct {
node
// The name of the database.
Database string
// The name of the retention policy.
RetentionPolicy string
// The name of the measurement.
Measurement string
// The write consistency to use when writing the data.
WriteConsistency string
// The precision to use when writing the data.
Precision string
// Static set of tags to add to all data points before writing them.
//tick:ignore
Tags map[string]string
}
func newInfluxDBOutNode(wants EdgeType) *InfluxDBOutNode {
return &InfluxDBOutNode{
node: node{
desc: "influxdb_out",
wants: wants,
provides: NoEdge,
},
Tags: make(map[string]string),
}
}
// Add a static tag to all data points.
// Tag can be called more than once.
//
// tick:property
func (i *InfluxDBOutNode) Tag(key, value string) *InfluxDBOutNode {
i.Tags[key] = value
return i
}