I am looking for a solution to add dynamic tags to my metrics.
e.g. the host a virtual machine is running on can change during the runtime of telegraf, but it is crucial to label the metrics of my VMs with the host the VM is running on.
I found the option of environment variables as global tags, but I think they are only read at the start of telegraf - not during the runtime.
The VM and Host measurements should already have the tag for esxhostname. I imagine if the VM moves host then the next time it reports in then you should get the latest tag value.
thanks a lot for your answer.
The vSphere Plugin works pretty fine, but in this case I am dealing with Oracle VM - and Oracle VM doesn’t give you much information about your VMs
Telegraf is running on the VM? If you send Telegraf a SIGHUP it will reload the configuration and restart plugins, and it should also check the hostname again.