metrics

package
v1.1.2-0...-68df96b Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetricsHolder []AnkaMetric

Functions

func AddMetric

func AddMetric(m AnkaMetric)

func ConvertMetricToGauge

func ConvertMetricToGauge(m prometheus.Collector) (prometheus.Gauge, error)

func ConvertMetricToGaugeVec

func ConvertMetricToGaugeVec(m prometheus.Collector) (*prometheus.GaugeVec, error)

func ConvertToInstancesData

func ConvertToInstancesData(d interface{}) ([]types.Instance, error)

func ConvertToNodeData

func ConvertToNodeData(d interface{}) ([]types.Node, error)

func ConvertToRegistryData

func ConvertToRegistryData(d interface{}) (*types.Registry, error)

func CreateGaugeMetric

func CreateGaugeMetric(name string, help string) prometheus.Gauge

func CreateGaugeMetricVec

func CreateGaugeMetricVec(name string, help string, labels []string) *prometheus.GaugeVec

Types

type AnkaMetric

type AnkaMetric interface {
	GetPrometheusMetric() prometheus.Collector
	GetEvent() events.Event
	GetEventHandler() func(interface{}) error
}

type BaseAnkaMetric

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

func (BaseAnkaMetric) GetEvent

func (this BaseAnkaMetric) GetEvent() events.Event

func (BaseAnkaMetric) GetPrometheusMetric

func (this BaseAnkaMetric) GetPrometheusMetric() prometheus.Collector

type InstanceStateMetric

type InstanceStateMetric struct {
	BaseAnkaMetric
}

func (InstanceStateMetric) GetEventHandler

func (this InstanceStateMetric) GetEventHandler() func(interface{}) error

type InstanceStatePerMetric

type InstanceStatePerMetric struct {
	BaseAnkaMetric
	HandleData func([]types.Instance, *prometheus.GaugeVec)
}

func (InstanceStatePerMetric) GetEventHandler

func (this InstanceStatePerMetric) GetEventHandler() func(interface{}) error

type NodeGroupMetric

type NodeGroupMetric struct {
	BaseAnkaMetric
	HandleData func([]types.Node, []types.NodeGroup, *prometheus.GaugeVec)
}

func (NodeGroupMetric) GetEventHandler

func (this NodeGroupMetric) GetEventHandler() func(interface{}) error

type NodeMetric

type NodeMetric struct {
	BaseAnkaMetric
	HandleData func(types.Node, *prometheus.GaugeVec, prometheus.Labels)
}

TODO: can we make prometheus.GaugeVec support also .Gauge?

func (NodeMetric) GetEventHandler

func (this NodeMetric) GetEventHandler() func(interface{}) error

type NodeStatesMetric

type NodeStatesMetric struct {
	BaseAnkaMetric
	HandleData func([]types.Node, *prometheus.GaugeVec)
}

TODO: can we make prometheus.GaugeVec support also .Gauge?

func (NodeStatesMetric) GetEventHandler

func (this NodeStatesMetric) GetEventHandler() func(interface{}) error

type NodesMetric

type NodesMetric struct {
	BaseAnkaMetric
	HandleData func([]types.Node, prometheus.Gauge)
}

func (NodesMetric) GetEventHandler

func (this NodesMetric) GetEventHandler() func(interface{}) error

type RegistryMetric

type RegistryMetric struct {
	BaseAnkaMetric
	HandleData func(*types.Registry, prometheus.Gauge)
}

func (RegistryMetric) GetEventHandler

func (this RegistryMetric) GetEventHandler() func(interface{}) error

Jump to

Keyboard shortcuts

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