Documentation ¶
Index ¶
- Variables
- type Controller
- type SocketCollector
- func (sc SocketCollector) Collect(ch chan<- prometheus.Metric)
- func (sc SocketCollector) Describe(ch chan<- *prometheus.Desc)
- func (sc *SocketCollector) RemoveMetrics(hosts []string, registry prometheus.Gatherer)
- func (sc *SocketCollector) SetHosts(hosts sets.String)
- func (sc *SocketCollector) Start()
- func (sc *SocketCollector) Stop()
Constants ¶
This section is empty.
Variables ¶
var PrometheusNamespace = "gateway"
PrometheusNamespace default metric namespace
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct { prometheus.Collector // contains filtered or unexported fields }
Controller defines base metrics about the rbd-gateway
func NewController ¶
func NewController() *Controller
NewController creates a new prometheus collector for the gateway controller operations
func (Controller) Collect ¶
func (cm Controller) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (Controller) Describe ¶
func (cm Controller) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector
func (*Controller) SetServerNum ¶
func (cm *Controller) SetServerNum(httpNum, tcpNum int)
SetServerNum sets the number of active domain
type SocketCollector ¶
type SocketCollector struct { prometheus.Collector // contains filtered or unexported fields }
SocketCollector stores prometheus metrics and ingress meta-data
func NewSocketCollector ¶
func NewSocketCollector(gatewayHost string, metricsPerHost bool) (*SocketCollector, error)
NewSocketCollector creates a new SocketCollector instance using the ingress watch namespace and class used by the controller
func (SocketCollector) Collect ¶
func (sc SocketCollector) Collect(ch chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (SocketCollector) Describe ¶
func (sc SocketCollector) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector
func (*SocketCollector) RemoveMetrics ¶
func (sc *SocketCollector) RemoveMetrics(hosts []string, registry prometheus.Gatherer)
RemoveMetrics deletes prometheus metrics from prometheus for hosts and host that are not available anymore. Ref: https://godoc.org/github.com/prometheus/client_golang/prometheus#CounterVec.Delete
func (*SocketCollector) SetHosts ¶
func (sc *SocketCollector) SetHosts(hosts sets.String)
SetHosts sets the hostnames that are being served by the ingress controller This set of hostnames is used to filter the metrics to be exposed
func (*SocketCollector) Start ¶
func (sc *SocketCollector) Start()
Start listen for connections in the unix socket and spawns a goroutine to process the content