aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prometheus.scm9
1 files 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