From 68820efcbd68a0aa2c25850f811ed5d7cc70029d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 10 Dec 2020 09:21:43 +0000 Subject: Allow passing label-values to call-with-duration-metric --- prometheus.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))))) -- cgit v1.2.3