Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogBuffer ¶
func NewLogBuffer(maxLines int) *logBuffer
NewLogBuffer creates log buffer with max line number limit. Because we only match logs in the log buffer, the max buffer line number is also the max pattern line number we support. Smaller buffer line number means less memory and cpu usage, but also means less lines of patterns we support.
Types ¶
type LogBuffer ¶
type LogBuffer interface { // Push pushes log into the log buffer. Push(*types.Log) // Match with regular expression in the log buffer. Match(string) []*types.Log // String returns a concatenated string of the buffered logs. String() string }
LogBuffer buffers the logs and supports match in the log buffer with regular expression.
type LogMonitor ¶
type LogMonitor interface { // Start starts the log monitor. Start() (<-chan *types.Status, error) // Stop stops the log monitor. Stop() }
LogMonitor monitors the log and reports node problem condition and event according to the rules.
func NewLogMonitorOrDie ¶
func NewLogMonitorOrDie(configPath string) LogMonitor
NewLogMonitorOrDie create a new LogMonitor, panic if error occurs.
type MonitorConfig ¶
type MonitorConfig struct { // WatcherConfig is the configuration of log watcher. watchertypes.WatcherConfig // BufferSize is the size (in lines) of the log buffer. BufferSize int `json:"bufferSize"` // Source is the source name of the log monitor Source string `json:"source"` // DefaultConditions are the default states of all the conditions log monitor should handle. DefaultConditions []types.Condition `json:"conditions"` // Rules are the rules log monitor will follow to parse the log file. Rules []logtypes.Rule `json:"rules"` }
MonitorConfig is the configuration of log monitor.
Click to show internal directories.
Click to hide internal directories.