Import socket and add hostname to every metric