NewGauge
NewGauge creates a new labeled gauge. Label keys must be set before instantiating. If the unlabeled option is given, this object will also instantiate and emit another gauge with the given name with an _unlabeled suffix. See labeled.SetMetricsKeys for information about how to configure that.
def NewGauge(
name: string,
description: string,
scope: promutils.Scope,
opts: ...MetricOption
) - > Gauge
Creates a new labeled gauge. Label keys must be set before instantiating. If the unlabeled option is given, this object will also instantiate and emit another gauge with the given name with an _unlabeled suffix. See labeled.SetMetricsKeys for information about how to configure that.
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | The name of the gauge. This name will be sanitized for Prometheus compatibility. |
| description | string | A descriptive string explaining the purpose of the gauge. |
| scope | promutils.Scope | The Prometheus scope to which this gauge will be registered. |
| opts | ...MetricOption | Optional configurations for the gauge, such as EmitUnlabeledMetricOption to emit an additional unlabeled gauge, or AdditionalLabelsOption to specify extra labels. |
Returns
| Type | Description |
|---|---|
Gauge | A new Gauge object configured with the specified name, description, scope, and options. |