package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
HdrEnabled returns whether or not the HdrHistogram model is enabled in the metric package.
MakeGraphiteExporter returns an initialized graphite exporter.
MakeHistogramSnapshot returns a new HistogramSnapshot instance, backed by the provided Histogram.
MakePrometheusExporter returns an initialized prometheus exporter.
MakePrometheusExporterForSelectedMetrics returns an initialized prometheus exporter.
MergeWindowedHistogram adds the bucket counts, sample count, and sample sum from the previous windowed histogram to those of the current windowed histogram.
NewAggregationRule creates a new AggregationRule.
NewAlertingRule creates a new AlertingRule.
NewCounter creates a counter.
NewCounterFloat64 creates a counter.
NewExportedCounterVec creates a new CounterVec containing labeled counters to be exported to an external collector; the contained counters are not aggregated or persisted to the tsdb (see aggmetric.Counter for a counter that persists the aggregation of n labeled child metrics).
NewExportedGaugeVec creates a new GaugeVec containing labeled gauges to be exported to an external collector, but is not persisted by the internal TSDB, nor are the metrics in the vector aggregated in any way.
NewExportedHistogramVec creates a new HistogramVec containing labeled counters to be exported to an external collector; the contained histograms are not aggregated or persisted to the tsdb (see aggmetric.Histogram for a counter that persists the aggregation of n labeled child metrics).
NewFunctionalGauge creates a Gauge metric whose value is determined when asked for by calling the provided function.
NewGauge creates a Gauge.
NewGaugeFloat64 creates a GaugeFloat64.
NewHdrHistogram initializes a given Histogram.
NewHdrLatency is a convenience function which returns a histogram with suitable defaults for latency tracking.
NewManualWindowHistogram is a prometheus-backed histogram.
NewPrometheusRuleExporter creates a new PrometheusRuleExporter.
NewRegistry creates a new Registry.
NewRuleRegistry creates a new RuleRegistry.
NewUniqueCounter creates a counter.
SubtractPrometheusHistograms subtracts the prev histogram from the cur histogram, in place modifying the cur histogram.
TestingSetNow changes the clock used by the metric system.
# Constants
CardinalityLimit is the max number of distinct label values combinations for any given MetricVec.
HdrHistogramMaxLatency is the maximum value tracked in latency histograms.
HistogramModePreferHdrLatency will cause the returned histogram to use the HdrHistgoram model and be configured with suitable defaults for latency tracking iff useHdrHistogramsEnvVar is enabled.
HistogramModePrometheus will force the constructed histogram to use the Prometheus histogram model, regardless of the value of useHdrHistogramsEnvVar.
TestSampleInterval is passed to histograms during tests which don't want to concern themselves with supplying a "correct" interval.
WindowedHistogramWrapNum is the number of histograms to keep in rolling window.
# Variables
HistogramMetricComputers is a slice of all the HistogramMetricComputer that are used to record (windowed) histogram metrics into TSDB.
# Structs
AggregationRule encapsulates a way to specify how one or more metrics should be aggregated together.
AlertingRule encapsulates an alert specification for one or more metrics.
A Counter holds a single mutable atomic value.
CounterVec wraps a prometheus.CounterVec; it is not aggregated or persisted.
A Gauge atomically stores a single integer value.
A GaugeFloat64 atomically stores a single float64 value.
GaugeVec is a collector for gauges that have a variable set of labels.
GraphiteExporter scrapes PrometheusExporter for metrics and pushes them to a Graphite or Carbon server.
A HdrHistogram collects observed values by keeping bucketed counts.
Histogram is a prometheus-backed histogram.
HistogramMetricComputer is the computation function used to compute and store histogram metrics into the internal TSDB, along with the suffix to be attached to the metric.
HistogramSnapshot represents a point-in-time snapshot of a Histogram metric, against which calculations like Mean, Total, and Quantiles can be calculated.
HistogramVec wraps a prometheus.HistogramVec; it is not aggregated or persisted.
ManualWindowHistogram is a prometheus-backed histogram.
PrometheusExporter contains a map of metric families (a metric with multiple labels).
PrometheusRuleExporter initializes recording and alert rules once from the registry.
PrometheusRuleGroup is a list of recording and alerting rules.
PrometheusRuleNode represents an individual rule node within the YAML output.
A Registry is a list of metrics.
RuleRegistry is a list of all rules (AlertingRule and AggregationRule).
UniqueCounter performs set cardinality estimation.
# Interfaces
CumulativeHistogram represents a histogram with data over the cumulative lifespan of the histogram metric.
Iterable provides a method for synchronized access to interior objects.
PrometheusExportable is the standard interface for an individual metric that can be exported to prometheus.
PrometheusIterable is an extension of PrometheusExportable to indicate that this metric comprises children metrics which augment the parent's label values.
Rule interface exposes an API for alerting and aggregation rules to be consumed.
Struct can be implemented by the types of members of a metric container so that the members get automatically registered.
WindowedHistogram represents a histogram with data over recent window of time.