Add ability to exclude db/bucket tag from influxdb outputs (#6184)
This commit is contained in:
@@ -94,6 +94,7 @@ type HTTPConfig struct {
|
||||
ContentEncoding string
|
||||
Database string
|
||||
DatabaseTag string
|
||||
ExcludeDatabaseTag bool
|
||||
RetentionPolicy string
|
||||
Consistency string
|
||||
SkipDatabaseCreation bool
|
||||
@@ -250,6 +251,10 @@ func (c *httpClient) Write(ctx context.Context, metrics []telegraf.Metric) error
|
||||
batches[db] = make([]telegraf.Metric, 0)
|
||||
}
|
||||
|
||||
if c.config.ExcludeDatabaseTag {
|
||||
metric.RemoveTag(c.config.DatabaseTag)
|
||||
}
|
||||
|
||||
batches[db] = append(batches[db], metric)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user