From fba2005362ce234fefa92e6ad00e499262b3ec4e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 5 Dec 2020 17:49:07 +0000 Subject: Fix call-with-duration-metric to work with multiple values --- prometheus.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/prometheus.scm b/prometheus.scm index 0d44377..53859c5 100644 --- a/prometheus.scm +++ b/prometheus.scm @@ -355,9 +355,12 @@ The metric with the name @var{metric-name} is fetched from the registry metric-name))) (start-time (current-time))) - (let ((result (thunk))) - (metric-observe metric (- (current-time) start-time)) - result))) + (call-with-values + thunk + (lambda results + (metric-observe metric (- (current-time) start-time)) + + (apply values results))))) (define (write-metrics registry port) "Write all metrics from the given @var{registry} to @var{port} in -- cgit v1.2.3