2018-11-06 05:34:28 +08:00
### Contributing
1. [Sign the CLA][cla].
2021-08-04 05:05:22 +08:00
2. Open a [new issue][] to discuss the changes you would like to make. This is
2018-11-06 05:34:28 +08:00
not strictly required but it may help reduce the amount of rework you need
to do later.
2021-08-04 05:05:22 +08:00
3. Make changes or write plugin using the guidelines in the following
2018-11-06 05:34:28 +08:00
documents:
- [Input Plugins][inputs]
- [Processor Plugins][processors]
- [Aggregator Plugins][aggregators]
- [Output Plugins][outputs]
2021-08-04 05:05:22 +08:00
4. Ensure you have added proper unit tests and documentation.
5. Open a new [pull request][].
6. The pull request title needs to follow [conventional commit format ](https://www.conventionalcommits.org/en/v1.0.0/#summary )
2021-09-10 03:37:50 +08:00
**Note:** If you have a pull request with only one commit, then that commit needs to follow the conventional commit format or the `Semantic Pull Request` check will fail. This is because github will use the pull request title if there are multiple commits, but if there is only one commit it will use it instead.
#### Contributing an External Plugin *(new)*
Input, output, and processor plugins written for internal Telegraf can be run as externally-compiled plugins through the [Execd Input ](/plugins/inputs/execd ), [Execd Output ](/plugins/outputs/execd ), and [Execd Processor ](/plugins/processors/execd ) Plugins without having to change the plugin code.
Follow the guidelines of how to integrate your plugin with the [Execd Go Shim ](/plugins/common/shim ) to easily compile it as a separate app and run it with the respective `execd` plugin.
Check out our [guidelines ](/docs/EXTERNAL_PLUGINS.md#external-plugin-guidelines ) on how to build and set up your external plugins to run with `execd` .
2020-05-14 23:19:19 +08:00
2019-08-17 01:32:29 +08:00
#### Security Vulnerability Reporting
InfluxData takes security and our users' trust very seriously. If you believe you have found a security issue in any of our
open source projects, please responsibly disclose it by contacting security@influxdata.com. More details about
security vulnerability reporting,
including our GPG key, [can be found here ](https://www.influxdata.com/how-to-report-security-vulnerabilities/ ).
2018-11-06 05:34:28 +08:00
### GoDoc
2016-02-14 02:50:43 +08:00
2016-10-05 22:16:53 +08:00
Public interfaces for inputs, outputs, processors, aggregators, metrics,
2018-11-06 05:34:28 +08:00
and the accumulator can be found in the GoDoc:
2016-02-14 02:50:43 +08:00
[](https://godoc.org/github.com/influxdata/telegraf)
2018-11-06 05:34:28 +08:00
### Common development tasks
2015-08-29 00:18:46 +08:00
2018-11-06 05:34:28 +08:00
**Adding a dependency:**
2016-01-21 03:30:52 +08:00
2020-03-17 07:24:02 +08:00
Telegraf uses Go modules. Assuming you can already build the project, run this in the telegraf directory:
2016-01-21 03:30:52 +08:00
2020-03-17 07:24:02 +08:00
1. `go get github.com/[dependency]/[new-package]`
2016-01-21 03:30:52 +08:00
2018-11-06 05:34:28 +08:00
**Unit Tests:**
2015-10-08 06:11:52 +08:00
2018-11-06 05:34:28 +08:00
Before opening a pull request you should run the linter checks and
the short tests.
2015-10-08 06:11:52 +08:00
```
2018-11-06 05:34:28 +08:00
make check
make test
2016-10-05 22:16:53 +08:00
```
2018-11-06 05:34:28 +08:00
**Execute integration tests:**
2015-09-10 01:00:19 +08:00
2020-03-17 07:24:02 +08:00
(Optional)
2017-11-08 05:54:36 +08:00
Running the integration tests requires several docker containers to be
running. You can start the containers with:
```
2019-04-03 02:53:11 +08:00
docker-compose up
2017-11-08 05:54:36 +08:00
```
2015-09-10 01:00:19 +08:00
2021-01-27 02:06:12 +08:00
To run only the integration tests use:
```
make test-integration
```
To run the full test suite use:
2017-11-08 05:54:36 +08:00
```
make test-all
```
2015-09-10 01:00:19 +08:00
2017-11-08 05:54:36 +08:00
Use `make docker-kill` to stop the containers.
2018-11-06 05:34:28 +08:00
2021-04-23 07:51:21 +08:00
### For more developer resources
- [Code Style][codestyle]
- [Deprecation][deprecation]
- [Logging][logging]
- [Metric Format Changes][metricformat]
- [Packaging][packaging]
- [Logging][logging]
- [Packaging][packaging]
- [Profiling][profiling]
- [Reviews][reviews]
- [Sample Config][sample config]
2018-11-06 05:34:28 +08: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
2021-04-23 07:51:21 +08:00
[codestyle]: /docs/developers/CODE_STYLE.md
[deprecation]: /docs/developers/DEPRECATION.md
[logging]: /docs/developers/LOGGING.md
[metricformat]: /docs/developers/METRIC_FORMAT_CHANGES.md
[packaging]: /docs/developers/PACKAGING.md
[profiling]: /docs/developers/PROFILING.md
[reviews]: /docs/developers/REVIEWS.md
[sample config]: /docs/developers/SAMPLE_CONFIG.md