Currently, when mage build is run from the x-pack/functionbeat folder, it builds two executables: x-pack/functionbeat/functionbeat (the manager, which is intended to be executed locally) and x-pack/functionbeat/providers/aws/functionbeat-aws (the executable to be invoked by the serverless provider, AWS in this case).
The former should be built for the local platform but the latter should be built for linux/amd64 as that will be the platform used in the serverless environment, at least in AWS (and that's the only provider we have at the moment).
So we should adjust the build target in the magefile.go accordingly.
Currently, when
mage buildis run from thex-pack/functionbeatfolder, it builds two executables:x-pack/functionbeat/functionbeat(the manager, which is intended to be executed locally) andx-pack/functionbeat/providers/aws/functionbeat-aws(the executable to be invoked by the serverless provider, AWS in this case).The former should be built for the local platform but the latter should be built for
linux/amd64as that will be the platform used in the serverless environment, at least in AWS (and that's the only provider we have at the moment).So we should adjust the
buildtarget in themagefile.goaccordingly.