Open chrbrnracn opened 2 years ago
Hi @chrbrnracn, thanks for the bug report.
Start is called once when the plugin is started: https://github.com/influxdata/telegraf/blob/f7aab29381798bc27d877bff238643246fa719a9/agent/agent.go#L265
It looks like this code came in with PR #8822
I'm not familiar with refreshing the token in this context. Is it something that Azure SQL Database requires regularly?
Are you able to prepare a fix and submit a PR for this?
Those tokens expire after usually 24 hours so it must be refreshed regularly. So the token refresh should not only run from Start but regularly, maybe before every update. The getTokenProvider function is >90% about checkig token expiry and getting new tokens. So maybe it would be sufficient to call this function on a regular basis.
I'm not a Go developer so unfortunately I can't prepare a fix for that. My findings where just from reading the code.
Worrying that this bug (that we are now also experiencing) has had no resolution in over a year.
Is the sqlserver input mothballed ?
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.22.3 (git: HEAD ff950615)
Docker
No response
Steps to reproduce
Expected behavior
Token is refreshed (shortly) before the expiration
Actual behavior
Token seems to be not refreshed
Additional info
In the master branch
When/how often is the Start function called?