Adding metrics to TaskInvoker in serverRegistry