My requirement is to replicate metric values from CloudWatch to InfluxDB. I really don’t want to manage servers, so opsless/serverless deployment is prefered. Telegraf with CloudWatch input plugin is a good candidate. But it is not serverless solution.
Has anyone any hackish recommendation how to run Telegraf as a stateless function and not as a daemon? I have already checked the common sources (GitHub, Google), but without any success.
You might be able to hack it together but you would need to move some code out of the internal package. Check cmd/telegraf/telegraf.go to see how to create a agent.Agent using a config.Config. Also, this code does not have a stable API, even if it is publically exported, and in fact there is some ongoing work right now that will switch some code around. The only public API we maintain backwards compatibility for is the config file.