influxdata / influxdata/influxdb
Set Telegraf hostname from enviromental variable
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Seems like influxdb v2 `load-data/telegrafs` currently creates configs like the following:
```ini
hostname = ""
omit_hostname = false
```
When using such a config in a `telegraf` docker container, it takes on the hostname of the container and not the docker host.
This can obviously be undesirable when it is used as the telegraf instance for the host.
I imagine that by setting it to something like `"$TELEGRAF_HOSTNAME"` this could easily be solved, while retaining the existing behavior if the env var is unset?
Contributor guide
Research direction
Begin with the InfluxDB v2 `load-data/telegrafs` config-generation entry point and inspect how it is used in a Telegraf Docker container. The issue names no source file or test; done means the generated configuration uses the environment-provided hostname when set while retaining current behavior when it is unset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100