metrics

package
v1.1.2-0...-5d0101c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DEFAULT_REFRESH_METRIC_SECONDS = 600

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 ConvertToRegistryDiskData

func ConvertToRegistryDiskData(d interface{}) (*types.RegistryDisk, error)

func ConvertToRegistryTemplatesData

func ConvertToRegistryTemplatesData(d interface{}) ([]types.Template, 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 (bam BaseAnkaMetric) GetEvent() events.Event

func (BaseAnkaMetric) GetPrometheusMetric

func (bam BaseAnkaMetric) GetPrometheusMetric() prometheus.Collector

type InstanceStateMetric

type InstanceStateMetric struct {
	BaseAnkaMetric
}

func (InstanceStateMetric) GetEventHandler

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

type InstanceStatePerMetric

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

func (InstanceStatePerMetric) GetEventHandler

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

type NodeGroupMetric

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

func (NodeGroupMetric) GetEventHandler

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

type NodeMetric

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

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

func (NodeMetric) GetEventHandler

func (nm 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 (nsm NodeStatesMetric) GetEventHandler() func(interface{}) error

type NodesMetric

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

func (NodesMetric) GetEventHandler

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

type RegistryDiskMetric

type RegistryDiskMetric struct {
	BaseAnkaMetric
	HandleData func(*types.RegistryDisk, prometheus.Gauge)
}

func (RegistryDiskMetric) GetEventHandler

func (rdm RegistryDiskMetric) GetEventHandler() func(interface{}) error

type RegistryTemplateMetric

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

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

func (RegistryTemplateMetric) GetEventHandler

func (rtm RegistryTemplateMetric) GetEventHandler() func(interface{}) error

type RegistryTemplatesMetric

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

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

func (RegistryTemplatesMetric) GetEventHandler

func (rtm RegistryTemplatesMetric) GetEventHandler() func(interface{}) error

Jump to

Keyboard shortcuts

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