diff --git a/CHANGELOG.md b/CHANGELOG.md index c2d7247c..e917d0a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Added - Allow Pushgateway to now require job names for compatibility with Gravel Gateway. +- Allow `histogram.startTime()` to be used with exemplars. ## [15.0.0] - 2023-10-09 diff --git a/index.d.ts b/index.d.ts index 5824a2f8..13e0051e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -498,6 +498,19 @@ export class Histogram { */ startTimer(labels?: LabelValues): (labels?: LabelValues) => number; + /** + * Start a timer with exemplar. Calling the returned function will observe the duration in + * seconds in the histogram. + * @param labels Object with label keys and values + * @param exemplarLabels Object with label keys and values for exemplars + * @return Function to invoke when timer should be stopped. The value it + * returns is the timed duration. + */ + startTimer( + labels?: LabelValues, + exemplarLabels?: LabelValues, + ): (labels?: LabelValues, exemplarLabels?: LabelValues) => number; + /** * Reset histogram values */