2018-11-05 21:34:28 +00:00
|
|
|
### Contributing
|
|
|
|
|
|
|
|
1. [Sign the CLA][cla].
|
|
|
|
1. Open a [new issue][] to discuss the changes you would like to make. This is
|
|
|
|
not strictly required but it may help reduce the amount of rework you need
|
|
|
|
to do later.
|
|
|
|
1. Make changes or write plugin using the guidelines in the following
|
|
|
|
documents:
|
|
|
|
- [Input Plugins][inputs]
|
|
|
|
- [Processor Plugins][processors]
|
|
|
|
- [Aggregator Plugins][aggregators]
|
|
|
|
- [Output Plugins][outputs]
|
|
|
|
1. Ensure you have added proper unit tests and documentation.
|
|
|
|
1. Open a new [pull request][].
|
|
|
|
|
|
|
|
### GoDoc
|
2016-02-13 18:50:43 +00:00
|
|
|
|
2016-10-05 14:16:53 +00:00
|
|
|
Public interfaces for inputs, outputs, processors, aggregators, metrics,
|
2018-11-05 21:34:28 +00:00
|
|
|
and the accumulator can be found in the GoDoc:
|
2016-02-13 18:50:43 +00:00
|
|
|
|
|
|
|
[![GoDoc](https://godoc.org/github.com/influxdata/telegraf?status.svg)](https://godoc.org/github.com/influxdata/telegraf)
|
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
### Common development tasks
|
2015-08-28 16:18:46 +00:00
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
**Adding a dependency:**
|
2016-01-20 19:30:52 +00:00
|
|
|
|
2016-01-25 17:59:44 +00:00
|
|
|
Assuming you can already build the project, run these in the telegraf directory:
|
2016-01-20 19:30:52 +00:00
|
|
|
|
2018-07-24 21:57:24 +00:00
|
|
|
1. `dep ensure -vendor-only`
|
|
|
|
2. `dep ensure -add github.com/[dependency]/[new-package]`
|
2016-01-20 19:30:52 +00:00
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
**Unit Tests:**
|
2015-10-07 22:11:52 +00:00
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
Before opening a pull request you should run the linter checks and
|
|
|
|
the short tests.
|
2015-10-07 22:11:52 +00:00
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
**Run static analysis:**
|
2015-10-07 22:11:52 +00:00
|
|
|
|
|
|
|
```
|
2018-11-05 21:34:28 +00:00
|
|
|
make check
|
2016-02-13 18:50:43 +00:00
|
|
|
```
|
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
**Run short tests:**
|
2016-10-05 14:16:53 +00:00
|
|
|
|
|
|
|
```
|
2018-11-05 21:34:28 +00:00
|
|
|
make test
|
2016-10-05 14:16:53 +00:00
|
|
|
```
|
|
|
|
|
2018-11-05 21:34:28 +00:00
|
|
|
**Execute integration tests:**
|
2015-09-09 17:00:19 +00:00
|
|
|
|
2017-11-07 21:54:36 +00:00
|
|
|
Running the integration tests requires several docker containers to be
|
|
|
|
running. You can start the containers with:
|
|
|
|
```
|
2019-04-02 18:53:11 +00:00
|
|
|
docker-compose up
|
2017-11-07 21:54:36 +00:00
|
|
|
```
|
2015-09-09 17:00:19 +00:00
|
|
|
|
2017-11-07 21:54:36 +00:00
|
|
|
And run the full test suite with:
|
|
|
|
```
|
|
|
|
make test-all
|
|
|
|
```
|
2015-09-09 17:00:19 +00:00
|
|
|
|
2017-11-07 21:54:36 +00:00
|
|
|
Use `make docker-kill` to stop the containers.
|
2018-11-05 21:34:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
[cla]: https://www.influxdata.com/legal/cla/
|
|
|
|
[new issue]: https://github.com/influxdata/telegraf/issues/new/choose
|
|
|
|
[pull request]: https://github.com/influxdata/telegraf/compare
|
|
|
|
[inputs]: /docs/INPUTS.md
|
|
|
|
[processors]: /docs/PROCESSORS.md
|
|
|
|
[aggregators]: /docs/AGGREGATORS.md
|
|
|
|
[outputs]: /docs/OUTPUTS.md
|