From 878430cadc43693551bdbf71bf5731d894eb0338 Mon Sep 17 00:00:00 2001 From: Nikita Volkov Date: Sun, 25 Feb 2024 16:21:24 +0300 Subject: [PATCH 1/2] Extend changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4accc5..2e15d45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # 0.11 -- Optional observability event stream, which can be interpreted into log records and metrics. +- Optional observability event stream added. Provides a flexible mechanism for monitoring the healthiness of the pool via logs and metrics. # 0.10.1 From d7162ce36551d95aaf656d1e24ec61edb3c32bc4 Mon Sep 17 00:00:00 2001 From: Nikita Volkov Date: Sun, 25 Feb 2024 17:05:59 +0300 Subject: [PATCH 2/2] Extend the observability docs --- src/library/exposed/Hasql/Pool/Observation.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/library/exposed/Hasql/Pool/Observation.hs b/src/library/exposed/Hasql/Pool/Observation.hs index d0e26a0..1a207b5 100644 --- a/src/library/exposed/Hasql/Pool/Observation.hs +++ b/src/library/exposed/Hasql/Pool/Observation.hs @@ -1,18 +1,27 @@ +-- | Interface for processing observations of the status of the pool. +-- +-- Provides a flexible mechanism for monitoring the healthiness of the pool via logs and metrics without any opinionated choices on the actual monitoring technologies. +-- Specific interpreters are encouraged to be created as extension libraries. module Hasql.Pool.Observation where import Hasql.Pool.Prelude +-- | An observation of a change of the state of a pool. data Observation - = ConnectionObservation + = -- | Status of one of the pool's connections has changed. + ConnectionObservation -- | Generated connection ID. -- For grouping the observations by one connection. UUID - -- | Connection status that it has entered. + -- | Status that the connection has entered. ConnectionStatus deriving (Show, Eq) +-- | Status of a connection. data ConnectionStatus = -- | Connection is being established. + -- + -- This is the initial status of every connection. ConnectingConnectionStatus | -- | Connection is established and not occupied. ReadyForUseConnectionStatus @@ -24,6 +33,7 @@ data ConnectionStatus TerminatedConnectionStatus ConnectionTerminationReason deriving (Show, Eq) +-- | Explanation of why a connection was terminated. data ConnectionTerminationReason = -- | The age timeout of the connection has passed. AgingConnectionTerminationReason