telemetry

package
v0.0.0-...-864a747 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Measurements

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

Measurements collects measurements for prometheus.

func Run

func Run(ctx context.Context, cancel context.CancelFunc, port int) (*Measurements, error)

Run starts collecting metrics and server with prometheus telemetry endpoint. Returns Measurements structure if successfully started or cancels context otherwise. Default port of 2112 is used if port value is set to 0.

func (*Measurements) AddToGauge

func (m *Measurements) AddToGauge(name string, f float64) bool

AddToGauge adds to gauge the value if entity with given name exists.

func (*Measurements) CreateUpdateObservableGauge

func (m *Measurements) CreateUpdateObservableGauge(name, description string)

CreateUpdateObservableGauge creats or updates observable gauge.

func (*Measurements) CreateUpdateObservableHistogram

func (m *Measurements) CreateUpdateObservableHistogram(name, description string)

CreateUpdateObservableHistogram creates or updates observable histogram.

func (*Measurements) DecrementGauge

func (m *Measurements) DecrementGauge(name string) bool

DecrementGauge decrements gauge the value if entity with given name exists.

func (*Measurements) IncrementGauge

func (m *Measurements) IncrementGauge(name string) bool

IncrementGauge increments gauge the value if entity with given name exists.

func (*Measurements) RecordHistogramTime

func (m *Measurements) RecordHistogramTime(name string, t time.Duration) bool

RecordHistogramTime records histogram time if entity with given name exists.

func (*Measurements) RecordHistogramValue

func (m *Measurements) RecordHistogramValue(name string, f float64) bool

RecordHistogramValue records histogram value if entity with given name exists.

func (*Measurements) RemoveFromGauge

func (m *Measurements) RemoveFromGauge(name string, f float64) bool

RemoveFromGauge removes from gauge the value if entity with given name exists.

func (*Measurements) SetGauge

func (m *Measurements) SetGauge(name string, f float64) bool

SetGauge sets the gauge to the value if entity with given name exists.

func (*Measurements) SetToCurrentTimeGauge

func (m *Measurements) SetToCurrentTimeGauge(name string) bool

SetToCurrentTimeGauge sets the gauge to the current time if entity with given name exists.

Jump to

Keyboard shortcuts

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