feat: Log PoolRequest and PoolRequestFullfilled observations (#3925)

This commit is contained in:
Taimoor Zaeem
2025-02-28 12:01:10 -05:00
committed by GitHub
parent 1a287edf7e
commit c9a625ced6
4 changed files with 59 additions and 20 deletions
+4 -1
View File
@@ -142,7 +142,10 @@ observationMessage = \case
SQL.ReleaseConnectionTerminationReason -> "release"
SQL.NetworkErrorConnectionTerminationReason _ -> "network error" -- usage error is already logged, no need to repeat the same message.
)
_ -> mempty
PoolRequest ->
"Trying to borrow a connection from pool"
PoolRequestFullfilled ->
"Borrowed a connection from the pool"
where
showMillis :: Double -> Text
showMillis x = toS $ showFFloat (Just 1) (x * 1000) ""