NewCounter
Creates a new labeled counter. Label keys must be set before instantiating a counter. See labeled.SetMetricsKeys for information about to configure that.
def NewCounter(
name: string,
description: string,
scope: promutils.Scope,
opts: ...MetricOption
) - > Counter
Creates a new labeled counter. Label keys must be set before instantiating a counter using labeled.SetMetricsKeys.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The name of the metric. This name will be sanitized to conform to Prometheus metric naming conventions. |
| description | string | A descriptive help text for the metric. |
| scope | promutils.Scope | The Prometheus scope to which the counter will be registered. |
| opts | ...MetricOption | Optional configurations for the counter, such as EmitUnlabeledMetricOption to emit an unlabeled metric or AdditionalLabelsOption to specify additional labels. |
Returns
| Type | Description |
|---|---|
Counter | A new Counter instance configured with the specified name, description, scope, and options. |