docs: Add source tag best practices to the metric schema docs (#11620)

This commit is contained in:
reimda 2022-08-03 15:27:21 -06:00 committed by GitHub
parent 478290c503
commit f001c99184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -157,6 +157,17 @@ should be made to switch between these two styles but if given the option it
is preferred to use the non-reseting variant. This style is more resilient in
the face of downtime and does not contain a fixed time element.
### Source tag
When metrics are gathered from another host, the metric schema should have a tag
named "source" that contains the other host's name. See [this feature
request](https://github.com/influxdata/telegraf/issues/4413) for details.
The metric schema doesn't need to have a tag for the host running
telegraf. Telegraf agent code can add a tag named "host" and by default
containing the hostname reported by the kernel. This can be configured through
the "hostname" and "omit_hostname" agent settings.
## Go Best Practices
In general code should follow best practice describe in [Code Review