You will need to setup several volume mounts as well as some environment variables:
docker run --name telegraf \
-v /:/hostfs:ro \
-e HOST_ETC=/hostfs/etc \
-e HOST_PROC=/hostfs/proc \
-e HOST_SYS=/hostfs/sys \
-e HOST_VAR=/hostfs/var \
-e HOST_RUN=/hostfs/run \
-e HOST_MOUNT_PREFIX=/hostfs \
telegraf
Go uses a pure Go resolver by default for name resolution. This resolver behaves differently than the C library functions but is more efficient when used with the Go runtime.
If you encounter problems or want to use more advanced name resolution methods that are unsupported by the pure Go resolver, you can switch to the cgo resolver.
If running manually set:
export GODEBUG=netdns=cgo
If running as a service add the environment variable to /etc/default/telegraf
:
GODEBUG=netdns=cgo
High series cardinality, when not properly managed, can cause high load on your database. Telegraf attempts to avoid creating series with high cardinality, but some monitoring workloads such as tracking containers are are inherently high cardinality. These workloads can still be monitored, but care must be taken to manage cardinality growth.
You can use the following techniques to avoid cardinality issues:
- Use metric filtering options to exclude unneeded measurements and tags.
- Write to a database with an appropriate retention policy.
- Consider using the Time Series Index.
- Monitor your databases using the show cardinality commands.
- Consult the InfluxDB documentation for the most up-to-date techniques.