monitoring

package
v0.0.0-...-90deddd Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeMetricsNames = map[string]bool{
	"node_disk_read_bytes_total":       true,
	"node_disk_reads_completed_total":  true,
	"node_disk_writes_completed_total": true,
	"node_disk_written_bytes_total":    true,

	"node_filefd_allocated": true,
	"node_filefd_maximum":   true,

	"node_load1":  true,
	"node_load5":  true,
	"node_load15": true,

	"node_vmstat_oom_kill": true,
	// contains filtered or unexported fields
}

Functions

func NewMetricsLogger

func NewMetricsLogger(url string, p time.Duration, restrict map[string]bool, log *log.Logger) *monitor

NewMetricsLogger periodically (every p duration) fetches prometheus metrics from the given url and logs them to the given logger. If restrict is provided, only the metrics specified will be logged.

func NewNodeOomDetector

func NewNodeOomDetector(nodeMetricsUrl string, log *log.Logger) *oomDetector

Types

type MetricsMonitor

type MetricsMonitor interface {
	// Go starts monitoring of metrics using the given context.
	// Typically Go would never return until context cancellation and hence should be run in a goroutine.
	Go(ctx context.Context)
}

Jump to

Keyboard shortcuts

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