Documentation ¶
Overview ¶
Initializes supervision over cluster and controller metrics uses prometheus gauges and counters
Index ¶
Constants ¶
const ( // HeartBeatGraceSeconds is an added grace-period that a heartbeat signal has // to come back successfully. HeartBeatGraceSeconds int64 = 180 )
Variables ¶
var ( // Heartbeat global heartbeat variable Heartbeat = time.Now() // Healthy global health variable Healthy = true )
Functions ¶
func Check ¶
func Check(e error)
Check examins an error. On nil it returns and on not-nil it logs the error and calls Fatal (corresponding to os.Exit(1))
func UpdateHeartbeat ¶ added in v0.0.7
func UpdateHeartbeat()
Types ¶
type ClusterMetrics ¶
type ClusterMetrics struct { ExcessNodes prometheus.Gauge NumberOfNonTaintedNodes prometheus.Gauge NumberOfNodes prometheus.Gauge NumberOfPods prometheus.Gauge UnschedulableNodes prometheus.Gauge CPUUtilization prometheus.Gauge RAMUtilization prometheus.Gauge }
ClusterMetrics is struct of prometheus metrics to be exported
func InitClusterMetrics ¶
func InitClusterMetrics(prefix string) *ClusterMetrics
InitClusterMetrics initializes these metrics
func (*ClusterMetrics) PublishClusterMetrics ¶
func (cm *ClusterMetrics) PublishClusterMetrics(clusterState *types.ClusterManifest)
PublishClusterMetrics updates the exported metrics
func (*ClusterMetrics) PublishNodeUnschedulable ¶
func (cm *ClusterMetrics) PublishNodeUnschedulable(nodesMap map[string]types.NodeManifest)
PublishNodeUnschedulable updates the number of unschedulable nodes
type DrainerMetrics ¶
type DrainerMetrics struct { // Drainer Metrics NodesCordoned prometheus.Counter NodesDrained prometheus.Counter NodesUncordoned prometheus.Counter }
DrainerMetrics is struct of prometheus metrics to be exported
func InitDrainerMetrics ¶
func InitDrainerMetrics(prefix string) *DrainerMetrics
InitDrainerMetrics initializes these metrics
type Handler ¶
Handler implements a HTTP response handler that reports on the current liveness status of the controller
type Supervisor ¶
type Supervisor struct { Prefix string DrainerMetrics *DrainerMetrics ClusterMetrics *ClusterMetrics }
Supervisor is an object to manage the exported prometheus metrics
func InitSupervisor ¶
func InitSupervisor(prefix string) *Supervisor
InitSupervisor initializes the supervisor using the two contexts, drainer metrics and cluster metrics
func (*Supervisor) StartSupervising ¶
func (s *Supervisor) StartSupervising()
StartSupervising opens a web port that can be used by prometheus to track the metrics we are exposing