aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-05 17:49:07 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-05 17:49:07 +0000
commitfba2005362ce234fefa92e6ad00e499262b3ec4e (patch)
treeb9ae43faffe00703b515aca1add78152639f577d
parent12d3d9de676f518eccf0a384d461cc4c035939b0 (diff)
downloadprometheus-fba2005362ce234fefa92e6ad00e499262b3ec4e.tar
prometheus-fba2005362ce234fefa92e6ad00e499262b3ec4e.tar.gz
Fix call-with-duration-metric to work with multiple values
-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