Skip to main content

NewOperationHistogram

NewOperationHistogram creates 2 histogram metrics for tracking success & failure durations.

def NewOperationHistogram(
scope: promutils.Scope,
labels: ...string
) - > Operation

Creates 2 histogram metrics for tracking success & failure durations. The resulting operations requires len(labels) + 1 labels, where the last label is the respective "operation". Histograms have higher performance impact on Prometheus server when calculating quantiles: https://prometheus.io/docs/practices/histograms/#quantiles

Parameters

NameTypeDescription
scopepromutils.ScopeThe Prometheus scope to register the new histogram metrics under.
labels...stringA variadic list of label names to be used for the histogram metrics. An additional "operation" label will be appended automatically.

Returns

TypeDescription
OperationAn Operation struct containing success and failure histogram vector metrics.