How to implement telegraf in a jenkins build to send data to a influxdb instance?

Hey,

So I am having issues with my jenkins build of a new vm, and it deletes everything so I cant access logs or view the compute engine of the vm. I wanted to see if their is a way to implement telegraf into this build and have it point to a influxdb I already have set up on a different instance, so during the build it can send cpu, memory, disk usage, etc metrics data to the influxdb so I can view that data before it fails. This will help me verify if I need to add more diskspace to this build, etc.