monitoring

package
v1.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package monitoring provides monitoring and metrics collection functionality for O² Control components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEnvAndRunType added in v1.43.0

func AddEnvAndRunType(ctx context.Context, envId, runType string) context.Context

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 SetupStreamClientInterceptor added in v1.41.0

func SetupStreamClientInterceptor(metricName string, convert NameConvertType) grpc.StreamClientInterceptor

func SetupUnaryClientInterceptor added in v1.41.0

func SetupUnaryClientInterceptor(name string, convert NameConvertType) grpc.UnaryClientInterceptor

func Stop

func Stop()

func Timer added in v1.41.0

func Timer(metric *Metric, unit TimeResolution) func()

Timer function is meant to be used with defer statement to measure runtime of given function: defer Timer(&metric, Milliseconds)()

func TimerSendHist added in v1.41.0

func TimerSendHist(metric *Metric, unit TimeResolution) func()

Timer function is meant to be used with defer statement to measure runtime of given function: defer Timer(&metric, Milliseconds)() sends measured value as SendHistogrammable(metric)

func TimerSendSingle added in v1.41.0

func TimerSendSingle(metric *Metric, unit TimeResolution) func()

Timer function is meant to be used with defer statement to measure runtime of given function: defer Timer(&metric, Milliseconds)() sends measured value as Send(metric)

Types

type EnvIDKey added in v1.43.0

type EnvIDKey struct{}

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 NameConvertType added in v1.41.0

type NameConvertType func(string) string

type RunTypeKey added in v1.43.0

type RunTypeKey struct{}

type Tag added in v1.35.0

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

type TagsType

type TagsType []Tag

type TimeResolution added in v1.41.0

type TimeResolution int
const (
	Millisecond TimeResolution = iota
	Nanosecond
)

Jump to

Keyboard shortcuts

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