aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-12-10 09:21:43 +0000
committerChristopher Baines <mail@cbaines.net>2020-12-10 09:21:43 +0000
commit68820efcbd68a0aa2c25850f811ed5d7cc70029d (patch)
treefba54ee3d697f9945d04e881509540940ed4532f
parent875d9994b0cd2ea8e13d5c2715360bf8d0876dc2 (diff)
downloadprometheus-68820efcbd68a0aa2c25850f811ed5d7cc70029d.tar
prometheus-68820efcbd68a0aa2c25850f811ed5d7cc70029d.tar.gz
Allow passing label-values to call-with-duration-metric
-rw-r--r--prometheus.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/prometheus.scm b/prometheus.scm
index 8d36b25..270ff28 100644
--- a/prometheus.scm
+++ b/prometheus.scm
@@ -361,6 +361,7 @@ values are the values."
(buckets %default-histogram-buckets)
docstring
(labels '())
+ (label-values '())
(label-preset-values '()))
"Call @var{thunk} while recording the duration in seconds between
calling @var{thunk} and the procedure ending using a metric by the
@@ -382,7 +383,9 @@ The metric with the name @var{metric-name} is fetched from the
(call-with-values
thunk
(lambda results
- (metric-observe metric (- (current-time) start-time))
+ (metric-observe metric
+ (- (current-time) start-time)
+ #:label-values label-values)
(apply values results)))))