diff options
author | Christopher Baines <mail@cbaines.net> | 2020-12-05 17:52:12 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-12-05 17:52:12 +0000 |
commit | 7868c838406635c546b388f8fa3b99b9597fd33f (patch) | |
tree | 282fe50a5be76337fe60a9e818a4a2ad1898a049 | |
parent | 6d9f8c57eb37dc5b6ca49a0f4cce8b83b752c169 (diff) | |
download | prometheus-7868c838406635c546b388f8fa3b99b9597fd33f.tar prometheus-7868c838406635c546b388f8fa3b99b9597fd33f.tar.gz |
Allow passing more options to call-with-duration-metric
-rw-r--r-- | prometheus.scm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/prometheus.scm b/prometheus.scm index 4dd750d..464b546 100644 --- a/prometheus.scm +++ b/prometheus.scm @@ -341,7 +341,12 @@ values are the values." 0)))))) buckets))))) -(define (call-with-duration-metric registry metric-name thunk) +(define* (call-with-duration-metric registry metric-name thunk + #:key + (buckets %default-histogram-buckets) + docstring + (labels '()) + (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 name of @var{metric-name}. @@ -353,7 +358,11 @@ The metric with the name @var{metric-name} is fetched from the (or (metrics-registry-fetch-metric registry metric-name) (make-histogram-metric registry - metric-name))) + metric-name + #:buckets buckets + #:docstring docstring + #:labels labels + #:label-preset-values label-preset-values))) (start-time (current-time))) (call-with-values thunk |