diff options
-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 |