logpattern

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlockedNodes

func GetBlockedNodes(ctx context.Context, taskID model.TaskID) ([]string, error)

GetBlockedNodes returns nodes you can't schedule on due to log pattern policies.

func Monitor

func Monitor(ctx context.Context,
	taskID model.TaskID, logs []*model.TaskLog, policies expconf.LogPoliciesConfig,
) error

Monitor checks for logs against any log_pattern_policies and takes action according to the policy.

func SetDefault

func SetDefault(p *LogPatternPolicies)

SetDefault sets the package level default for log pattern policies.

func TaskLogsFromDontRetryTriggers

func TaskLogsFromDontRetryTriggers(taskID model.TaskID, t []DontRetryTrigger) []*model.TaskLog

TaskLogsFromDontRetryTriggers returns informational task logs from dont retry triggers.

Types

type DontRetryTrigger

type DontRetryTrigger struct {
	Regex         string
	TriggeringLog string
}

DontRetryTrigger has information about don't retry policies that have been triggered.

func ShouldRetry

func ShouldRetry(ctx context.Context, taskID model.TaskID) ([]DontRetryTrigger, error)

ShouldRetry returns a list of any triggered log policies that prevent retrying a trial. Returns an empty list if taskID doesn't exist. Order is not guaranteed. Only returns first log that triggered each regex. Multiple policies with the same regex will only have one DontRetryTrigger.

type LogPatternPolicies

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

LogPatternPolicies performs log pattern checks.

func New

New create the log pattern policies singleton.

Jump to

Keyboard shortcuts

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