Skip to main content

NewHistogramStopWatch

Creates a new labeled HistogramStopWatch. Label keys must be set before instantiating a counter. See labeled.SetMetricsKeys for information about how to configure that.

def NewHistogramStopWatch(
name: string,
description: string,
scope: promutils.Scope,
opts: MetricOption
) - > HistogramStopWatch

Creates a new labeled HistogramStopWatch. Label keys must be set before instantiating a counter. See labeled.SetMetricsKeys for information about how to configure that.

Parameters

NameTypeDescription
namestringThe name of the histogram stopwatch, which will be sanitized for metric compatibility.
descriptionstringA descriptive string for the histogram stopwatch, providing context for its purpose.
scopepromutils.ScopeThe Prometheus scope to which the histogram stopwatch will be registered.
optsMetricOptionOptional configurations for the histogram stopwatch, such as emitting an unlabeled metric or adding additional labels.

Returns

TypeDescription
HistogramStopWatchA new HistogramStopWatch instance configured with the provided name, description, scope, and options.