monitoring

package
v1.26.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log = logger.New(logrus.StandardLogger(), "metrics")
)

Functions

func Send

func Send(metric Metric)

func Start

func Start(port uint16, endpointName string, messageBufferSize int) 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" \param messageBufferSize size of buffer for messages where messages are kept between scraping request.

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

func Stop

func Stop()

Types

type Metric

type Metric struct {
	Name      string     `json:"name"`
	Values    ValuesType `json:"values"`
	Tags      TagsType   `json:"tags,omitempty"`
	Timestamp int64      `json:"timestamp"`
}

func (*Metric) AddTag

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

func (*Metric) AddValue

func (metric *Metric) AddValue(valueName string, value any)

type TagsType

type TagsType map[string]any

type ValuesType

type ValuesType map[string]any

Jump to

Keyboard shortcuts

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