Adding customized metrics to track message flow