How to monitor other component if we use telegraf as separate container

Hello Team,

I have one use case please guide me if we can achive it or not

Suppose we have 4 containers and we have telegraf as separate container (not as sidecar) how we can get stats of other container

github------->telegraf
postgres------>telegraf
nexus---------->telegraf

and then we can output to influx and then display the same on grafana dashboard.

currently we are getting stats of only telegraf container not others as mentioned above

Please help us if we can write any input file to get stats all container,

Regards,
SAM

Yes that is possible. You have to make the logfiles/resources of the other containers, which telegraf wants to access to read the metrics, accessible for the telegraf container.
But this has nothing to do with telegraf, it is a problem you have to solve with docker.