Reimplement max retry count metric without using metrics listeners