metrics

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LabelsForShard

func LabelsForShard(namespace string, shard int64) map[string]any

Types

type Counter

type Counter interface {
	Inc()
	Add(incr int)
}

Counter is a monotonically increasing counter.

func NewCounter

func NewCounter(name string, description string, unit Unit, labels map[string]any) Counter

type Gauge

type Gauge interface {
	Unregister()
}

func NewGauge

func NewGauge(name string, description string, unit Unit, labels map[string]any, callback func() int64) Gauge

type Histogram

type Histogram interface {
	Record(value int)
}

func NewBytesHistogram

func NewBytesHistogram(name string, description string, labels map[string]any) Histogram

func NewCountHistogram

func NewCountHistogram(name string, description string, labels map[string]any) Histogram

type LatencyHistogram

type LatencyHistogram interface {
	Timer() Timer
}

func NewLatencyHistogram

func NewLatencyHistogram(name string, description string, labels map[string]any) LatencyHistogram

type PrometheusMetrics

type PrometheusMetrics struct {
	io.Closer
	// contains filtered or unexported fields
}

func Start

func Start(bindAddress string) (*PrometheusMetrics, error)

func (*PrometheusMetrics) Close

func (p *PrometheusMetrics) Close() error

func (*PrometheusMetrics) Port

func (p *PrometheusMetrics) Port() int

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func (Timer) Done

func (tm Timer) Done()

type Unit

type Unit string

Unit has been deprecated in otel: https://github.com/open-telemetry/opentelemetry-go/pull/3776

const (
	Dimensionless Unit = "1"
	Bytes         Unit = "By"
	Milliseconds  Unit = "ms"
)

type UpDownCounter

type UpDownCounter interface {
	Counter
	Dec()
	Sub(diff int)
}

UpDownCounter is a counter that is incremented and decremented to report the current state.

func NewUpDownCounter

func NewUpDownCounter(name string, description string, unit Unit, labels map[string]any) UpDownCounter

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL