Run telegraf as an embedded service within golang project

I need to run telegraf embedded in a golang service. The parent service needs to run as a docker container on kubernetes. Is it a recommended approach?
I need to control the gnmi subsciption of the telegraf from the parent service. As and when new devices are added, the parent service should add a new config file in config directory and telegraf should be able to create a new subscription .
On successfully establishing gnmi connection , telegraf should be able to communicate to parent service


I’m afraid there is not much prior art on running Telegraf as a library. A number of key functions are also stored inside the internal folder, making things private as well.

The Telegraf project does have official DockerHub images available as well as some Helm Charts. You may want to check those out as well.