code to export metrics to influxdb