metrics

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// VeryHighFalseDesiredSize : If the actual desired size is unknown, set it to this
	// and the desired_size metric will not be output for the group
	VeryHighFalseDesiredSize = 9999999999
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupState

type GroupState struct {
	GroupName       string
	WantedNodes     int
	DeletionEnabled bool
	Nodes           []Node
}

GroupState represents a group of nodes and their states

type Node

type Node struct {
	State  string
	Reason Reason
}

Node represents the state of a node's deletion, and the reason why we want it deleted

type Reason

type Reason string

Reason represents a reason that the controller would want to delete a node

const (
	// HasDeletionLabel means the node has the label specified in config.Ops.RequestDeletionLabel
	HasDeletionLabel Reason = "has_deletion_label"
	// TooOld means the node is older than the duration specified by config.Ops.DeletionAge
	TooOld Reason = "too_old"
	// ConfigurationChanged means the node configuration is out of sync with the ASG config
	ConfigurationChanged Reason = "configuration_changed"
)

type Reporter

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

Reporter is responsible for storing and serving prometheus metrics

func New

func New() *Reporter

New returns a new metrics reporter

func (*Reporter) Handler

func (m *Reporter) Handler(rsp http.ResponseWriter, req *http.Request)

Handler returns metrics in response to an HTTP request

func (*Reporter) SetGroupState

func (m *Reporter) SetGroupState(s map[string]GroupState)

SetGroupState sets what the controller thinks is the state of the group

Jump to

Keyboard shortcuts

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