libpq provides very detailed communication control. Therefore, to detect a heartbeat error through the conmgr process, you may need to modify the existing application logic.
See
Refer to "libpq - C Library" in the PostgreSQL Documentation on functions described below.