Documentation
¶
Index ¶
- func HTTPHandler() http.Handler
- func MustRegister(m Metric)
- func Register(m Metric) error
- type Counter
- type EmptyExporter
- func (e *EmptyExporter) HTTPHandler() http.Handler
- func (e *EmptyExporter) NewCounter(name, desc string, labelNames []string) Counter
- func (e *EmptyExporter) NewGauge(name, desc string, labelNames []string) Gauge
- func (e *EmptyExporter) NewHistogram(name, desc string, buckets []float64, labelNames []string) Histogram
- type Exporter
- type Gauge
- type Histogram
- type Metric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPHandler ¶
HTTPHandler returns http.Handler used to export metrics.
func MustRegister ¶
func MustRegister(m Metric)
MustRegister registers the provided Metric and panics if any error occurs.
Types ¶
type Counter ¶
Counter is a Metric that represents a single numerical value that only ever goes up.
func NewCounter ¶
NewCounter creates a Counter metric partitioned by the given label names.
type EmptyExporter ¶
type EmptyExporter struct {
}
func (*EmptyExporter) HTTPHandler ¶
func (e *EmptyExporter) HTTPHandler() http.Handler
func (*EmptyExporter) NewCounter ¶
func (e *EmptyExporter) NewCounter(name, desc string, labelNames []string) Counter
func (*EmptyExporter) NewGauge ¶
func (e *EmptyExporter) NewGauge(name, desc string, labelNames []string) Gauge
func (*EmptyExporter) NewHistogram ¶
func (e *EmptyExporter) NewHistogram(name, desc string, buckets []float64, labelNames []string) Histogram
type Exporter ¶
type Exporter interface {
// NewCounter creates a Counter metric partitioned by the given label names.
NewCounter(name, desc string, labelNames []string) Counter
// NewGauge creates a Gauge metric partitioned by the given label names.
NewGauge(name, desc string, labelNames []string) Gauge
// NewHistogram creates a histogram metric partitioned by the given label names.
NewHistogram(name, desc string, buckets []float64, labelNames []string) Histogram
// HTTPHandler returns http.Handler used to export metrics.
HTTPHandler() http.Handler
}
Exporter creates all kinds Metric, and return the http.Handler used to export metrics.
type Gauge ¶
Gauge is a Metric that represents a single numerical value that can arbitrarily go up and down.
type Histogram ¶
Histogram counts individual observations from an event or sample stream in configurable buckets.
type Metric ¶
type Metric interface {
// Register registers the Metric.
Register() error
// Unregister unregisters the Metric.
Unregister() bool
// Reset deletes all values of the Metric.
Reset()
}
Metric models basic operations of metric being exported. Implementations of Metric in this package are Counter, Gauge and Histogram.