Azure / azure-linux-extensions

Linux Virtual Machine Extensions for Azure
Apache License 2.0
304 stars 252 forks source link

Fix Telegraf not starting errors #1843

Closed aswatt closed 10 months ago

aswatt commented 10 months ago

If configuration had no metrics or perf counters set up to be collected, telegraf would (rightly) not be installed, but LAD's code would repeatedly try to start up telegraf every 30 seconds (and log the failure to extension.log). This fixes this bug to check if telegraf should be enabled based on the configuration.

Specifically, if there is a metrics section but no scheduledTransferPeriod value (and no perf counters section), our previous behavior was to try and set up metrics for PT1H and start telegraf, which wouldn't succeed as telegraf was never installed initially. This change lines us up with our current public docs, which clarify that at least one scheduledTransferPeriod should be specified.