You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by taimoorzaeem February 4, 2025
Problem
While working on #3802, we noticed in comment#3802 that we are not logging all observations. Namely PoolRequest and PoolRequestFullfilled (because we are only using them for metrics). Infact, we are just logging empty here for them here:
I think this needs a refactor and one way to solve this is to log these observations for loglevel >= debug. So it should be something like:
-- Logger.hs
o@PoolRequest->
when (logLevel >=LogDebug) $do
logWithZTime loggerState $ observationMessage o
o@PoolRequestFullfilled->
when (logLevel >=LogDebug) $do
logWithZTime loggerState $ observationMessage o
and
-- Observation.hsPoolRequest->"Trying to borrow a connection from pool"PoolRequestFullfilled->"Borrowed a connection from the pool"
What would be more important is to remove that mempty there, this to ensure we don't log empty lines accidentally like what happened on #3802 (comment)
The text was updated successfully, but these errors were encountered:
Discussed in #3899
Originally posted by taimoorzaeem February 4, 2025
Problem
While working on #3802, we noticed in comment#3802 that we are not logging all observations. Namely
PoolRequest
andPoolRequestFullfilled
(because we are only using them for metrics). Infact, we are just logging empty here for them here:postgrest/src/PostgREST/Observation.hs
Lines 140 to 142 in db85e64
This never gets executed because we intercept it in the
Logger.hs
:postgrest/src/PostgREST/Logger.hs
Lines 91 to 94 in db85e64
Solution
I think this needs a refactor and one way to solve this is to log these observations for
loglevel >= debug
. So it should be something like:and
What would be more important is to remove that mempty there, this to ensure we don't log empty lines accidentally like what happened on #3802 (comment)
The text was updated successfully, but these errors were encountered: