INFLUX_TOKEN variable removed

Please can someone tell me the correct method for ensurein this variable will not be overwriiten

Today my feeds from telegraf to influx failed after a perfectly normal apt upgrade
Why, because the systemd config file for the telegraf service had been overwritten, with no option as far as I could see to keep original. The new one looks the same as the old one, minus the Environment entry containing the token.
A simple scan of the file to preserve these would be sensible.
Alternatives, export in the
telegraf account, no its /bin/false
in root .profile?
in telegraf.conf?
in the indiidual telegraf file in telegraf.d, hardcoded?

Hi there,
I hope you are doing well. Just to understand your issue correctly your security token environment variable was overwritten after upgrading to the latest build of Telegraf?

What prevents you from hardcoding the token within the telegraf.conf file?

Nothing, just that examples in telegraf.conf showed as a reference to the environmental $INFLUX_TOKEN and not the actual value.

Re over written, yes, the service file in /lib/systemd/system is timestamped today, ie when I did the update, and the systemd Environmental entry was removed

Thank you for letting me know. Both approaches are acceptable, it just depends on your setup and overall system requirements. If you have no plans to update or change the token frequently then hardcoding is a simpler option. I will flag your issue with regards to the system environment variable.