monitoring

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format added in v1.35.0

func Format(writer io.Writer, metrics []Metric) error

func IsRunning added in v1.27.0

func IsRunning() bool

func Run added in v1.27.0

func Run(port uint16, endpointName string) error

\param port port where the scraping endpoint will be created \param endpointName name of the endpoint, which must start with a slash eg. "/internalmetrics"

If we attempt send more messages than the size of the buffer, these overflowing messages will be ignored and warning will be logged.

func Send

func Send(metric *Metric)

func SendHistogrammable added in v1.35.0

func SendHistogrammable(metric *Metric)

func Stop

func Stop()

func TimerMS added in v1.35.0

func TimerMS(metric *Metric) func()

Timer* functions are meant to be used with defer statement to measure runtime of given function: defer TimerNS(&metric)()

func TimerNS added in v1.35.0

func TimerNS(metric *Metric) func()

Types

type FieldsType added in v1.35.0

type FieldsType map[string]any

type Metric

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

func NewDefaultMetric added in v1.35.0

func NewDefaultMetric(name string, timestamp time.Time) Metric

Return empty metric, it is used right now mostly in string to report metrics correctly to influxdb use NewECSMetric

func NewMetric added in v1.35.0

func NewMetric(name string) Metric

creates empty metric with tag subsystem=ECS, which is used by Telegraf to send metrics from ECS to correct bucket

func (*Metric) AddTag

func (metric *Metric) AddTag(tagName string, value string)

func (*Metric) MergeFields added in v1.35.0

func (metric *Metric) MergeFields(other *Metric)

func (*Metric) SetFieldFloat64 added in v1.35.0

func (metric *Metric) SetFieldFloat64(fieldName string, field float64)

func (*Metric) SetFieldInt64 added in v1.35.0

func (metric *Metric) SetFieldInt64(fieldName string, field int64)

func (*Metric) SetFieldUInt64 added in v1.35.0

func (metric *Metric) SetFieldUInt64(fieldName string, field uint64)

type MetricsAggregate added in v1.35.0

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

func NewMetricsAggregate added in v1.35.0

func NewMetricsAggregate() *MetricsAggregate

func (*MetricsAggregate) AddMetric added in v1.35.0

func (this *MetricsAggregate) AddMetric(metric *Metric)

func (*MetricsAggregate) Clear added in v1.35.0

func (this *MetricsAggregate) Clear()

func (*MetricsAggregate) GetMetrics added in v1.35.0

func (this *MetricsAggregate) GetMetrics() []Metric

type MetricsReservoirSampling added in v1.35.0

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

func NewMetricsReservoirSampling added in v1.35.0

func NewMetricsReservoirSampling() *MetricsReservoirSampling

func (*MetricsReservoirSampling) AddMetric added in v1.35.0

func (this *MetricsReservoirSampling) AddMetric(metric *Metric)

func (*MetricsReservoirSampling) Clear added in v1.35.0

func (this *MetricsReservoirSampling) Clear()

func (*MetricsReservoirSampling) GetMetrics added in v1.35.0

func (this *MetricsReservoirSampling) GetMetrics() []Metric

type Tag added in v1.35.0

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

type TagsType

type TagsType []Tag

Jump to

Keyboard shortcuts

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