metrics

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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

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

func (m *Metrics) FlushReason(reason string)

fulfills the es.bulkerMetrics interface.

func (*Metrics) FlushedBytes

func (m *Metrics) FlushedBytes(numBytes float64)

func (*Metrics) FlushedMsgs

func (m *Metrics) FlushedMsgs(numMsgs float64)

func (*Metrics) IndexedDocumentsBytesAdd

func (m *Metrics) IndexedDocumentsBytesAdd(num float64)

func (*Metrics) IndexedDocumentsCountAdd

func (m *Metrics) IndexedDocumentsCountAdd(num float64)

func (*Metrics) LostPartitionAssignmentInc

func (m *Metrics) LostPartitionAssignmentInc()

func (*Metrics) MsgConsumedSizeObserve

func (m *Metrics) MsgConsumedSizeObserve(num float64)

fulfills the kafka.consumerMetrics interface.

func (*Metrics) MsgProducedSizeObserve

func (m *Metrics) MsgProducedSizeObserve(num float64)

fulfills the kafka.producerMetrics interface.

func (*Metrics) RebalanceInc

func (m *Metrics) RebalanceInc(reason string)

func (*Metrics) SessionIndexingFailCountInc

func (m *Metrics) SessionIndexingFailCountInc()

func (*Metrics) SuccessfullyProducedMsgInc

func (m *Metrics) SuccessfullyProducedMsgInc()

func (*Metrics) UnsuccessfullyProducedMsgInc

func (m *Metrics) UnsuccessfullyProducedMsgInc()

Jump to

Keyboard shortcuts

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