Documentation
¶
Index ¶
- Constants
- func IncrCounter(val float32, keys ...string)
- func IncrCounterWithLabels(keys []string, val float32, labels []metrics.Label)
- func MeasureSince(start time.Time, keys ...string)
- func NewLabel(name, value string) metrics.Label
- func SetGauge(val float32, keys ...string)
- func SetGaugeWithLabels(keys []string, val float32, labels []metrics.Label)
- type GatherResponse
- type Metrics
Constants ¶
const ( FormatDefault = "" FormatPrometheus = "prometheus" FormatText = "text" )
Metrics supported format types.
Variables ¶
This section is empty.
Functions ¶
func IncrCounter ¶
IncrCounter provides a wrapper functionality for emitting a counter metric with global labels (if any).
func IncrCounterWithLabels ¶
IncrCounterWithLabels provides a wrapper functionality for emitting a counter metric with global labels (if any) along with the provided labels.
func MeasureSince ¶
MeasureSince provides a wrapper functionality for emitting a a time measure metric with global labels (if any).
func NewLabel ¶
func NewLabel(name, value string) metrics.Label
NewLabel creates a new instance of Label with name and value
func SetGauge ¶
SetGauge provides a wrapper functionality for emitting a gauge metric with global labels (if any).
func SetGaugeWithLabels ¶
SetGaugeWithLabels provides a wrapper functionality for emitting a gauge metric with global labels (if any) along with the provided labels.
Types ¶
type GatherResponse ¶
GatherResponse is the response type of registered metrics
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics defines a wrapper around application telemetry functionality. It allows metrics to be gathered at any point in time. When creating a Metrics object, internally, a global metrics is registered with a set of sinks as configured by the operator. In addition to the sinks, when a process gets a SIGUSR1, a dump of formatted recent metrics will be sent to STDERR.