influxdata / influxdata/influxdb

Set Telegraf hostname from enviromental variable

Open
#17,283 2 comments 0 reactions 0 assignees View on GitHub
kind/enhancement team/ui
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.