Documentation
¶
Overview ¶
Package meter provides a simple meter system for metrics. The metrics are aggregated by the meter provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BatchBuckets = Buckets{0.1, 0.5, 1, 2.5, 5, 10, 30, 60, 120, 300}
BatchBuckets is the bucket set for batch-stream latency histograms. Batch-mode streams and lifecycle migration replays can run for minutes, so the upper bound extends to 300s instead of the 10s ceiling of DefBuckets.
var DefBuckets = Buckets{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}
DefBuckets is the default buckets for histograms.
var QueryLatencyBuckets = Buckets{.01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 30, 60}
QueryLatencyBuckets is the bucket set for liaison query-request latency. Queries that fan out to many data nodes can run for tens of seconds, so the upper bound extends to 60s instead of the 10s ceiling of DefBuckets.
var QueueLatencyBuckets = Buckets{
.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 30, 60, 120, 300,
600, 900, 1800, 3600, 10_800, 21_600, 43_200, 86_400,
}
QueueLatencyBuckets is the bucket set for durable queue-residence latency. A downstream outage can leave data queued for hours, so the upper bound extends to 24 hours while retaining the short-latency resolution of DefBuckets.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter interface {
Instrument
Inc(delta float64, labelValues ...string)
}
Counter is a metric that represents a single numerical value that only ever goes up.
type Gauge ¶
type Gauge interface {
Instrument
Set(value float64, labelValues ...string)
Add(delta float64, labelValues ...string)
}
Gauge is a metric that represents a single numerical value that can arbitrarily go up and down.
type HierarchicalScope ¶
type HierarchicalScope struct {
// contains filtered or unexported fields
}
HierarchicalScope is a Scope implementation that supports hierarchical scopes.
func (*HierarchicalScope) ConstLabels ¶
func (s *HierarchicalScope) ConstLabels(labels LabelPairs) Scope
ConstLabels returns a new scope with the given labels merged with the parent's labels.
func (*HierarchicalScope) GetLabels ¶
func (s *HierarchicalScope) GetLabels() LabelPairs
GetLabels returns the labels of this scope.
func (*HierarchicalScope) GetNamespace ¶
func (s *HierarchicalScope) GetNamespace() string
GetNamespace returns the namespace of this scope.
func (*HierarchicalScope) SubScope ¶
func (s *HierarchicalScope) SubScope(name string) Scope
SubScope creates a new sub-scope with the given name.
type Histogram ¶
type Histogram interface {
Instrument
Observe(value float64, labelValues ...string)
}
Histogram is a metric that represents the statistical distribution of a set of values.
type Instrument ¶
type Instrument interface {
// Delete the metric with the given label values.
Delete(labelValues ...string) bool
}
Instrument is the interface for a metric.
type LabelPairs ¶
LabelPairs is a map of label names to label values, which is used to identify a metric.
func ToLabelPairs ¶ added in v0.7.0
func ToLabelPairs(labelNames, labelValues []string) LabelPairs
ToLabelPairs converts the given label names and label values to a map of label names to label values.
func (LabelPairs) Merge ¶
func (p LabelPairs) Merge(other LabelPairs) LabelPairs
Merge merges the given label pairs with the current label pairs.
type Provider ¶
type Provider interface {
Counter(name string, labelNames ...string) Counter
Gauge(name string, labelNames ...string) Gauge
Histogram(name string, buckets Buckets, labelNames ...string) Histogram
Close()
}
Provider is the interface for a metrics provider, which is responsible for creating metrics.
type Scope ¶
type Scope interface {
ConstLabels(labels LabelPairs) Scope
SubScope(name string) Scope
GetNamespace() string
GetLabels() LabelPairs
}
Scope is a namespace wrapper for metrics.
func NewHierarchicalScope ¶
NewHierarchicalScope creates a new hierarchical scope.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package native provides a simple meter system for metrics.
|
Package native provides a simple meter system for metrics. |
|
Package prom provides a prometheus implementation for the meter system.
|
Package prom provides a prometheus implementation for the meter system. |