Skip to main content

NewSuccessAndFailureCounterVec

Creates a new SuccessAndFailureCounterVec, initializing success and failure counters with the provided scope and labels.

def NewSuccessAndFailureCounterVec(
scope: promutils.Scope,
labels: ...string
) - > SuccessAndFailureCounterVec

Creates a new SuccessAndFailureCounterVec instance, which encapsulates two Prometheus counter vectors: one for successful events and one for failed events. This allows for tracking the success and failure rates of operations with common labels.

Parameters

NameTypeDescription
scopepromutils.ScopeThe Prometheus scope used to register the new counter vectors. This scope provides the base for metric names and labels.
labels...stringA variadic list of label names that will be applied to both the success and failure counter vectors. These labels allow for distinguishing metrics by different dimensions.

Returns

TypeDescription
SuccessAndFailureCounterVecA new SuccessAndFailureCounterVec object initialized with success and failure counter vectors.