observability

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Normal                  = corev1.EventTypeNormal
	Warning                 = corev1.EventTypeWarning
	MonitorErrReason        = "MonitorError"
	MonitorErrMsgFmt        = "There was a problem monitoring for events in monitor '%s'"
	UncordonErrReason       = "UncordonError"
	UncordonErrMsgFmt       = "There was a problem while trying to uncordon the node: %s"
	UncordonReason          = "Uncordon"
	UncordonMsg             = "Node successfully uncordoned"
	PreDrainErrReason       = "PreDrainError"
	PreDrainErrMsgFmt       = "There was a problem executing the pre-drain task: %s"
	PreDrainReason          = "PreDrain"
	PreDrainMsg             = "Pre-drain task successfully executed"
	CordonErrReason         = "CordonError"
	CordonErrMsgFmt         = "There was a problem while trying to cordon the node: %s"
	CordonReason            = "Cordon"
	CordonMsg               = "Node successfully cordoned"
	CordonAndDrainErrReason = "CordonAndDrainError"
	CordonAndDrainErrMsgFmt = "There was a problem while trying to cordon and drain the node: %s"
	CordonAndDrainReason    = "CordonAndDrain"
	CordonAndDrainMsg       = "Node successfully cordoned and drained"
	PostDrainErrReason      = "PostDrainError"
	PostDrainErrMsgFmt      = "There was a problem executing the post-drain task: %s"
	PostDrainReason         = "PostDrain"
	PostDrainMsg            = "Post-drain task successfully executed"
)

Kubernetes event types, reasons and messages

Variables

View Source
var GetReasonForKind func(kind, monitor string) string = getReasonForKindV1

Functions

func InitProbes added in v1.12.2

func InitProbes(enabled bool, port int, endpoint string) error

InitProbes will initialize, register and expose, via http server, the probes.

func SetReasonForKindVersion added in v1.18.0

func SetReasonForKindVersion(version int) error

Types

type K8sEventRecorder added in v1.13.1

type K8sEventRecorder struct {
	record.EventRecorder
	// contains filtered or unexported fields
}

K8sEventRecorder wraps a Kubernetes event recorder with some extra information

func InitK8sEventRecorder added in v1.13.1

func InitK8sEventRecorder(enabled bool, nodeName string, sqsMode bool, nodeMetadata ec2metadata.NodeMetadata, extraAnnotationsStr string, clientSet *kubernetes.Clientset) (K8sEventRecorder, error)

InitK8sEventRecorder creates a Kubernetes event recorder

func (K8sEventRecorder) Emit added in v1.13.1

func (r K8sEventRecorder) Emit(nodeName string, eventType, eventReason, eventMsgFmt string, eventMsgArgs ...interface{})

Emit a Kubernetes event for the given node and with the given event type, reason and message

type Metrics

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

Metrics represents the stats for observability

func InitMetrics

func InitMetrics(enabled bool, port int) (Metrics, error)

InitMetrics will initialize, register and expose, via http server, the metrics with Opentelemetry.

func (Metrics) ErrorEventsInc

func (m Metrics) ErrorEventsInc(where string)

ErrorEventsInc will increment one for the event errors counter, partitioned by action, and only if metrics are enabled.

func (Metrics) NodeActionsInc

func (m Metrics) NodeActionsInc(action, nodeName string, eventID string, err error)

NodeActionsInc will increment one for the node stats counter, partitioned by action, nodeName and status, and only if metrics are enabled.

Jump to

Keyboard shortcuts

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