Documentation ¶
Overview ¶
Package metrics contains the struct used for exposing Prometheus metrics and a collector that works to collect metrics from the ES client.
The Metrics struct implements various *Metrics interfaces defined in other packages
Index ¶
- func NewESCollectorFunc(namespace, subsys string) func(*elasticsearch.Client) prometheus.Collector
- type ESCollector
- type Metrics
- func (m *Metrics) BulkIndexCountInc()
- func (m *Metrics) BulkIndexErrorCountInc()
- func (m *Metrics) BulkIndexRetryCountInc()
- func (m *Metrics) ESClientReloadInc()
- func (m *Metrics) FlushReason(reason string)
- func (m *Metrics) FlushedBytes(numBytes float64)
- func (m *Metrics) FlushedMsgs(numMsgs float64)
- func (m *Metrics) IndexedDocumentsBytesAdd(num float64)
- func (m *Metrics) IndexedDocumentsCountAdd(num float64)
- func (m *Metrics) LostPartitionAssignmentInc()
- func (m *Metrics) MsgConsumedSizeObserve(num float64)
- func (m *Metrics) MsgProducedSizeObserve(num float64)
- func (m *Metrics) RebalanceInc(reason string)
- func (m *Metrics) SessionIndexingFailCountInc()
- func (m *Metrics) SuccessfullyProducedMsgInc()
- func (m *Metrics) UnsuccessfullyProducedMsgInc()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewESCollectorFunc ¶
func NewESCollectorFunc(namespace, subsys string) func(*elasticsearch.Client) prometheus.Collector
NewESCollectorFunc creates a function that takes an *elasticsearch.Client and returns a prometheus.Collector, the namespace and subsystem for the prometheus metrics must be provided at creation time.
Types ¶
type ESCollector ¶
type ESCollector struct {
// contains filtered or unexported fields
}
ESCollector collects the metrics from the ES client so that we can serve them with the rest of the metrics. It implements the prometheus.Collector interface.
func (*ESCollector) Collect ¶
func (ec *ESCollector) Collect(ch chan<- prometheus.Metric)
Collect is the ESCollector implementation of the Collect(chan<- *prometheus.Collect) defined by the promtheus.Collector interface.
func (*ESCollector) Describe ¶
func (ec *ESCollector) Describe(ch chan<- *prometheus.Desc)
Describe is the ESCollector implementation of the Describe(chan<- *prometheus.Desc) defined by the promtheus.Collector interface.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics struct contains the various prometheus metrics collected by the indexer. It implements various *Metrics interfaces defined by the various components of the indexer.
func InitPrometheus ¶
func InitPrometheus( namespace, subsys string, flushedBytesBuckets, flushedMsgsBuckets []float64, ) (*Metrics, *prometheus.Registry, error)
InitPrometheus initialises the Metrics struct with the various metrics and registers the metrics with a *prometheus.Registry. Returns the initialised Metrics struct and the new Prometheus registry which needs to be exposed over HTTP to be collected.
func (*Metrics) BulkIndexCountInc ¶
func (m *Metrics) BulkIndexCountInc()
fulfills the es.indexerMetrics interface.
func (*Metrics) BulkIndexErrorCountInc ¶
func (m *Metrics) BulkIndexErrorCountInc()
func (*Metrics) BulkIndexRetryCountInc ¶
func (m *Metrics) BulkIndexRetryCountInc()
func (*Metrics) ESClientReloadInc ¶
func (m *Metrics) ESClientReloadInc()
func (*Metrics) FlushReason ¶
fulfills the es.bulkerMetrics interface.
func (*Metrics) FlushedBytes ¶
func (*Metrics) FlushedMsgs ¶
func (*Metrics) IndexedDocumentsBytesAdd ¶
func (*Metrics) IndexedDocumentsCountAdd ¶
func (*Metrics) LostPartitionAssignmentInc ¶
func (m *Metrics) LostPartitionAssignmentInc()
func (*Metrics) MsgConsumedSizeObserve ¶
fulfills the kafka.consumerMetrics interface.
func (*Metrics) MsgProducedSizeObserve ¶
fulfills the kafka.producerMetrics interface.
func (*Metrics) RebalanceInc ¶
func (*Metrics) SessionIndexingFailCountInc ¶
func (m *Metrics) SessionIndexingFailCountInc()
func (*Metrics) SuccessfullyProducedMsgInc ¶
func (m *Metrics) SuccessfullyProducedMsgInc()
func (*Metrics) UnsuccessfullyProducedMsgInc ¶
func (m *Metrics) UnsuccessfullyProducedMsgInc()