health

package
v0.0.0-alpha.0....-eeef803 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SerializedReadSingleTarget CheckName = "SerializedReadSingleTarget"
	QuorumReadSingleTarget     CheckName = "QuorumReadSingleTarget"
	GRPCReadySingleTarget      CheckName = "GRPCReadySingleTarget"
	QuorumRead                 CheckName = "QuorumRead"

	DefaultSlowRequestDuration = 500 * time.Millisecond
	DefaultContextDeadline     = 1 * time.Second
	DefaultNamespaceKey        = "/kubernetes.io/namespaces/default"
)
View Source
const (
	StdErrLogOutput = "stderr"
	StdOutLogOutput = "stdout"
)

Variables

View Source
var (
	ErrLogRotationInvalidLogOutput = fmt.Errorf("--log-outputs requires a single file path when --log-rotate-config-json is defined")
)

Functions

func GetZapLogger

func GetZapLogger(logLevel zapcore.Level, logOutputs []string, enableLogRotation bool, logRotateConfigJSON string) (*zap.Logger, error)

func LoglevelToZap

func LoglevelToZap(logLevel int) zapcore.Level

Types

type Check

type Check struct {
	Probe CheckFunc
	// contains filtered or unexported fields
}

func NewCheck

func NewCheck(lg *zap.Logger, client *clientv3.Client, targets []string) *Check

func (*Check) LogTermination

func (c *Check) LogTermination()

type CheckFunc

type CheckFunc func(context.Context, *Check)

func WithGRPCReadySingleTarget

func WithGRPCReadySingleTarget() CheckFunc

WithGRPCReadySingleTarget performs a gRPC dial to the endpoint and checks if the service is "Ready". This check ensures that the target subconn will be considered usable by the etcd client balancer for round robin requests. Ready does not preclude quorum.

func WithQuorumRead

func WithQuorumRead() CheckFunc

WithQuorumRead performs a quorate RangeRequest against all targets. This check ensures given an etcd client with multiple endpoint targets the client balancer can provide linearized read/write service to the apiserver.

func WithQuorumReadSingleTarget

func WithQuorumReadSingleTarget() CheckFunc

WithQuorumReadSingleTarget performs a quorate RangeRequest against a single target. This check is useful to understand exact timings on quorate availability on a per peer level. This single target test can fail on a minority of peer targets while WithQuorumRead passes. This can happen most commonly on node reboot during upgrades or during a static-pod rollout. But can also happen less during a network partition.

func WithSerializedReadSingleTarget

func WithSerializedReadSingleTarget() CheckFunc

WithSerializedReadSingleTarget performs a serialized RangeRequest against a single target. This test is of lower overall importance because linearized read/write are the default for kubernetes. But some requests will not fail if quorum is not established. Examples include WatchRequest that does no pass WithRequireLeader, DefragmentRequest, HashKVRequest and MemberList (3.4 and earlier).

type CheckName

type CheckName string

type CheckStatus

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

type CheckTarget

type CheckTarget string

type LogLine

type LogLine struct {
	Level           string `json:"level"`
	UnixTS          string `json:"ts"`
	Caller          string `json:"caller,omitempty"`
	Message         string `json:"msg"`
	Pod             string `json:"pod,omitempty"`
	DisruptionStart string `json:"start,omitempty"`
	DisruptionEnd   string `json:"end,omitempty"`
	Duration        string `json:"duration,omitempty"`
	Check           string `json:"check,omitempty"`
}

Jump to

Keyboard shortcuts

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