add: Log pg version details of listener connection

Follow-up to #4617 adding more information to log entry produced upon successful listener connection establishement.
This commit is contained in:
Michał Kłeczek
2026-01-27 15:44:05 -05:00
committed by Steve Chavez
parent 5356f4e973
commit 21b8c3458a
4 changed files with 19 additions and 12 deletions
+3 -3
View File
@@ -44,7 +44,7 @@ data Observation
| SchemaCacheSummaryObs Text
| SchemaCacheLoadedObs Double
| ConnectionRetryObs Int
| DBListenStart (Maybe ByteString) (Maybe ByteString) Text -- host, port, channel
| DBListenStart (Maybe ByteString) (Maybe ByteString) Text Text -- host, port, version string, channel
| DBListenFail Text (Either SQL.ConnectionError (Either SomeException ()))
| DBListenRetry Int
| DBListenBugHint -- https://github.com/PostgREST/postgrest/issues/3147
@@ -110,8 +110,8 @@ observationMessage = \case
"Attempting to reconnect to the database in " <> (show delay::Text) <> " seconds..."
QueryPgVersionError usageErr ->
"Failed to query the PostgreSQL version. " <> jsonMessage usageErr
DBListenStart host port channel -> do
"Listener connected to " <> show (fold $ host <> fmap (":" <>) port) <> " and listening for database notifications on the " <> show channel <> " channel"
DBListenStart host port fullName channel -> do
"Listener connected to " <> fullName <> " on " <> show (fold $ host <> fmap (":" <>) port) <> " and listening for database notifications on the " <> show channel <> " channel"
DBListenFail channel listenErr ->
"Failed listening for database notifications on the " <> show channel <> " channel. " <>
either showListenerConnError showListenerException listenErr