Thank you very much jpowers. This absolutely worked and a .exe is produced with GOOS=windows.
The next issue is that when running the custom builder, the config file is not included in the binary although I have a display the same as yours where it says importing configuration file, found 1 configuration file.
When trying --test arguments in Windows, this is displayed:
2024-07-31T17:30:50Z E! unable to load default config paths: no config file specified, and could not find one in $TELEGRAF_CONFIG_PATH, /.telegraf/telegraf.conf, C:\Program Files\Telegraf\telegraf.conf, or C:\Program Files\Telegraf\telegraf.d/*.conf
I wonder what the reasoning would be to compile a custom binary rather than using the pre-built telegraf compiled binary which is all inclusive? It seems like this would be a backwards step (especially considering 30mb vs 100mb is not much of a difference).
In other words, what would be the benefit?
Is there possibly a repo fork or someway to accomplish an embedded config within the binary? This being the goal.
For most users this is not a lot, but for some users it is a huge difference. Think embedded systems. Also consider use cases for users who want to strip out anything that is not actually used for security reasons.
Is there possibly a repo fork or someway to accomplish an embedded config within the binary? This being the goal.
You could certainly fork the project and try this. Essentially you could embed the config in the code and load it rather than one of the default locations.
Is there possibly a repo fork or someway to accomplish an embedded config within the binary? This being the goal.
@QuickWick currently that’s not possible but it might be possible to add this feature. Please open a feature request and outline why you would need this feature!
Yeah I mean we allow users to build a custom binary with their config embedded. I could see a clear use-case for this… That is, the file is embedded at compile time…