metrics

package
v0.3.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupOpentelemetry

func SetupOpentelemetry(ctx context.Context, attributes map[string]string, cfg config.Opentelemetry, metrics *Metrics) error

Types

type Counter

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

func NewCounter

func NewCounter(meter metric.Meter, name string, desc string) *Counter

func (*Counter) Add

func (c *Counter) Add(delta float64)

func (*Counter) With

func (c *Counter) With(labelValues ...string) metrics.Counter

type Gauge

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

func NewGauge

func NewGauge(meter metric.Meter, name string, desc string) *Gauge

func (*Gauge) Add

func (g *Gauge) Add(delta float64)

func (*Gauge) Set

func (g *Gauge) Set(delta float64)

func (*Gauge) With

func (g *Gauge) With(labelValues ...string) metrics.Gauge

type Histogram

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

func NewHistogram

func NewHistogram(meter metric.Meter, name string, desc string, unit string) *Histogram

func (*Histogram) Observe

func (h *Histogram) Observe(value float64)

func (*Histogram) With

func (h *Histogram) With(labelValues ...string) metrics.Histogram

type LabelValues

type LabelValues []string

func (LabelValues) ToLabels

func (lvs LabelValues) ToLabels() []attribute.KeyValue

func (LabelValues) With

func (lvs LabelValues) With(labelValues ...string) LabelValues

type Metrics

type Metrics struct {
	Enabled  bool
	Interval time.Duration

	RuntimeGoroutine    metrics.Gauge
	RuntimeAlloc        metrics.Gauge
	RuntimeSys          metrics.Gauge
	RuntimeMallocs      metrics.Gauge
	RuntimeFrees        metrics.Gauge
	RuntimeHeapObjects  metrics.Gauge
	RuntimePauseTotalNs metrics.Gauge
	RuntimeGC           metrics.Gauge

	AttemptTotalCounter              metrics.Counter
	AttemptFailedCounter             metrics.Counter
	AttemptPendingGauge              metrics.Gauge
	AttemptResponseDurationHistogram metrics.Histogram

	ProxyRequestCounter           metrics.Counter
	ProxyRequestDurationHistogram metrics.Histogram

	// events metrics
	EventTotalCounter   metrics.Counter
	EventPersistCounter metrics.Counter
	EventPendingGauge   metrics.Gauge
	// contains filtered or unexported fields
}

func New

func New(cfg config.MetricsConfig) (*Metrics, error)

func (*Metrics) Stop

func (m *Metrics) Stop() error

Jump to

Keyboard shortcuts

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