Instrument the resource pool checkout timeouts
This commit is contained in:
parent
f1add88867
commit
c18589249f
1 changed files with 16 additions and 0 deletions
|
|
@ -142,6 +142,22 @@
|
|||
|
||||
(resource-pool-default-timeout 5))
|
||||
|
||||
(let ((resource-pool-checkout-failures-metric
|
||||
(make-counter-metric registry
|
||||
"resource_pool_checkout_timeouts_total"
|
||||
#:labels '(pool_name))))
|
||||
(%resource-pool-timeout-handler
|
||||
(lambda (pool proc timeout)
|
||||
(let ((pool-name
|
||||
(cond
|
||||
((eq? pool (connection-pool)) "normal")
|
||||
((eq? pool (reserved-connection-pool)) "reserved")
|
||||
(else #f))))
|
||||
(when pool-name
|
||||
(metric-increment
|
||||
resource-pool-checkout-failures-metric
|
||||
#:label-values `((pool_name . ,pool-name))))))))
|
||||
|
||||
(spawn-fiber
|
||||
(lambda ()
|
||||
(with-resource-from-pool (connection-pool) conn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue