Telegraf / Server Hostname instead of id

Hi there,

I just deploy in my docker swarm (with caddy in reverseproxy role) and all is OK.
thanks to this guy : Grafana 8 - InfluxDB 2 - Telegraf - 2021 monitoring stack
It was very helpful.

Anyway, I have two questions.
1st question/ in my telegraf.conf for connect to influxdbv2 i must put my VIP ( delivered via keepalived container).
If i want to use container name like influxdb:8086 or the ingress ip like it doesn’t work. Dunno why. BTW the ingress ip is uses in my caddyfile with success.

2nd question/ when i browse my data in influxdb telegraf show servers id instead of servers hostname.
Maybe you have a tricks for this.

Thanks in advance,


Hello @neosaiyan,
I’m not sure. I’ve asked the Telegraf team. Thanks for your patience.

Hello Anais,
Thx for your reply.
For My second question i just see that is id of telegraf container(not host server). But if i could display a « name » instead of id it will be perfect.

@neosaiyan Sorry to hear you are having problems.

1st question re hostname: if you connect to the VM can you look up the hostname there? If not, then this is probably something related to your DNS settings

2nd question: telegraf will use whatever comes from hostname on a system, if it is reporting IPs then this is probably confirming that DNS in docker or between your containers is not quite setup