telemetry

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: GPL-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OngoingSyncStartMilli atomic.Int64

OngoingSyncStartMilli is to be updated by the main() function.

View Source
var Stats struct {
	// Config & co. are to be increased by the T sync once for every T object synced.
	Config, State, History, Overdue, HistoryCleanup com.Counter
}

Functions

func GetCurrentDbConnErr

func GetCurrentDbConnErr() (string, int64)

GetCurrentDbConnErr returns the last error message (or the empty string if not in an error state) and a timestamp in milliseconds of the last change from OK to error or from error to OK.

func NewGoMetrics

func NewGoMetrics() *goMetrics

func StartHeartbeat

func StartHeartbeat(
	ctx context.Context, client *redis.Client, logger *logging.Logger, ha ha, heartbeat *icingaredis.Heartbeat,
) *atomic.Pointer[SuccessfulSync]

StartHeartbeat periodically writes heartbeats to Redis for being monitored by Icinga 2. It returns an atomic pointer to SuccessfulSync, which contains synchronisation statistics that the caller should update.

func UpdateCurrentDbConnErr

func UpdateCurrentDbConnErr(err error)

UpdateCurrentDbConnErr updates the current error information stored in currentDbConnErr.

func WriteStats

func WriteStats(ctx context.Context, client *redis.Client, logger *logging.Logger)

WriteStats periodically forwards Stats to Redis for being monitored by Icinga 2.

Types

type SuccessfulSync

type SuccessfulSync struct {
	FinishMilli   int64
	DurationMilli int64
}

Jump to

Keyboard shortcuts

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