-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use build tags to select plugins (#11654)
- Loading branch information
Showing
338 changed files
with
1,763 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Customization | ||
|
||
You can build customized versions of Telegraf with a specific plugin set | ||
using [build-tags](https://pkg.go.dev/cmd/go#hdr-Build_constraints). | ||
The plugins can be selected either category-wise, i.e. `inputs`, `outputs`, | ||
`processors`, `aggregators` and `parsers` or individually, e.g. `inputs.modbus` | ||
or `outputs.influxdb`. | ||
|
||
Usually the build tags correspond to the plugin names used in the Telegraf | ||
configuration. To be sure, check the files in the corresponding | ||
`plugin/<category>/all` directory. Make sure to include all parsers you intend | ||
to use. | ||
|
||
__Note:__ You _always_ need to include the `custom` tag when customizing the | ||
build as otherwise _all_ plugins will be selected regardless of other tags. | ||
|
||
## Via make | ||
|
||
When using the project's makefile, the build can be customized via the | ||
`BUILDTAGS` environment variable containing a __space-separated__ list of the | ||
selected plugins (or categories) __and__ the `custom` tag. | ||
|
||
For example | ||
|
||
```shell | ||
BUILDTAGS="custom inputs outputs.influxdb_v2 parsers.json" make | ||
``` | ||
|
||
will build a customized Telegraf including _all_ `inputs`, the InfluxDB v2 | ||
`output` and the `json` parser. | ||
|
||
## Via `go build` | ||
|
||
If you wish to build Telegraf using native go tools, you can use the `go build` | ||
command with the `-tags` option. Specify a __space-separated__ list of the | ||
selected plugins (or categories) __and__ the `custom` tag as argument. | ||
|
||
For example | ||
|
||
```shell | ||
go build -tags "custom inputs outputs.influxdb_v2 parsers.json" ./cmd/telegraf | ||
``` | ||
|
||
will build a customized Telegraf including _all_ `inputs`, the InfluxDB v2 | ||
`output` and the `json` parser. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1 @@ | ||
package all | ||
|
||
import ( | ||
//Blank imports for plugins to register themselves | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/basicstats" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/derivative" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/final" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/histogram" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/merge" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/minmax" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/quantile" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/starlark" | ||
_ "github.com/influxdata/telegraf/plugins/aggregators/valuecounter" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.basicstats | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/basicstats" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.derivative | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/derivative" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.final | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/final" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.histogram | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/histogram" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.merge | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/merge" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.minmax | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/minmax" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.quantile | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/quantile" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.starlark | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/starlark" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || aggregators || aggregators.valuecounter | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/aggregators/valuecounter" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || inputs || inputs.activemq | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/inputs/activemq" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || inputs || inputs.aerospike | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/inputs/aerospike" // register plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build !custom || inputs || inputs.aliyuncms | ||
|
||
package all | ||
|
||
import _ "github.com/influxdata/telegraf/plugins/inputs/aliyuncms" // register plugin |
Oops, something went wrong.