Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(r Registry)
Register adds a Registry to the global registries. Any metrics that were created prior or after this call will also be created in this registry. This function is not thread safe, registries should be registered either before or after creating metrics, but not at the same time.
Types ¶
type Counter ¶
type Counter interface { // Inc adds Sum(vs) to the counter. Sum(vs) must be positive. // // If len(vs) == 0, increments the counter by 1. Inc(vs ...float64) }
Counter is a metric that can only increment its current count.
func NewCounter ¶
type Gauge ¶
type Gauge interface { // Inc adds Sum(vs) to the gauge. Sum(vs) must be positive. // // If len(vs) == 0, increments the gauge by 1. Inc(vs ...float64) // Dec subtracts Sum(vs) from the gauge. Sum(vs) must be positive. // // If len(vs) == 0, decrements the gauge by 1. Dec(vs ...float64) // Set replaces the gauge's current value with the provided value Set(float64) }
Gauge is a metric that allows incrementing and decrementing a value.
type Histogram ¶
type Histogram interface {
Observe(float64)
}
Histogram is a metric that builds a histogram from observed values.
func NewHistogram ¶
type LabeledCounter ¶
LabeledCounter is a counter that must have labels populated before use.
func NewLabeledCounter ¶
func NewLabeledCounter(name, help string, labels []string, opts ...Option) LabeledCounter
type LabeledGauge ¶
LabeledGauge describes a gauge that must have values populated before use.
func NewLabeledGauge ¶
func NewLabeledGauge(name, help string, labels []string, opts ...Option) LabeledGauge
type LabeledHistogram ¶
LabeledHistogram describes a histogram that must have labels populated before use.
func NewLabeledHistogram ¶
func NewLabeledHistogram(name, help string, labels []string, opts ...Option) LabeledHistogram
type LabeledTimer ¶
LabeledTimer is a timer that must have label values populated before use.
func NewLabeledTimer ¶
func NewLabeledTimer(name, help string, labels []string, opts ...Option) LabeledTimer
type Option ¶
type Option interface{}
Option is an option that can be applied on a metric. Registry implementations can and should define their own unique Option interface and only apply options meant for them.
type RecordBytesHistogram ¶ added in v0.5.0
type RecordBytesHistogram struct {
// contains filtered or unexported fields
}
RecordBytesHistogram wraps a histrogram metric and allows to observe record sizes in bytes.
func NewRecordBytesHistogram ¶ added in v0.5.0
func NewRecordBytesHistogram(h Histogram) RecordBytesHistogram
func (RecordBytesHistogram) Observe ¶ added in v0.5.0
func (m RecordBytesHistogram) Observe(r opencdc.Record)
type Registry ¶
type Registry interface { NewCounter(name, help string, opts ...Option) Counter NewGauge(name, help string, opts ...Option) Gauge NewTimer(name, help string, opts ...Option) Timer NewHistogram(name, help string, opts ...Option) Histogram NewLabeledCounter(name, help string, labels []string, opts ...Option) LabeledCounter NewLabeledGauge(name, help string, labels []string, opts ...Option) LabeledGauge NewLabeledTimer(name, help string, labels []string, opts ...Option) LabeledTimer NewLabeledHistogram(name, help string, labels []string, opts ...Option) LabeledHistogram }
Registry is an object that can create and collect metrics.
Directories ¶
Path | Synopsis |
---|---|
Package noop exposes implementations of metrics which do not do anything.
|
Package noop exposes implementations of metrics which do not do anything. |