metrics

package
v1.0.0-beta.150 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerMetrics

type BrokerMetrics struct {
	// Broker source (learned, configured, internal, logical)
	Source metric.Int64Gauge
	// Broker state (INIT, DOWN, CONNECT, AUTH, APIVERSION_QUERY, AUTH_HANDSHAKE, UP, UPDATE)
	State metric.Int64Gauge
	// Time since last broker state change (microseconds)
	StateAge metric.Int64Gauge
	// Number of requests awaiting transmission to broker
	RequestsAwaitingTransmission metric.Int64Gauge
	// Number of messages awaiting transmission to broker
	MessagesAwaitingTransmission metric.Int64Gauge
	// Number of requests in-flight to broker awaiting response
	InflightRequestsAwaitingResponse metric.Int64Gauge
	// Number of messages in-flight to broker awaiting response
	InflightMessagesAwaitingResponse metric.Int64Gauge
	// Total number of requests sent
	RequestsSent metric.Int64Counter
	// Total number of bytes sent
	RequestBytesSent metric.Int64Counter
	// Total number of transmission errors
	RequestErrors metric.Int64Counter
	// Total number of request retries
	RequestRetries metric.Int64Counter
	// Microseconds since last socket send (or -1 if no sends yet for current connection).
	LastSocketSend metric.Int64Counter
	// Total number of requests timed out
	RequestTimeouts metric.Int64Counter
	// Total number of responses received
	ResponsesReceived metric.Int64Counter
	// Total number of bytes received
	ResponseBytesReceived metric.Int64Counter
	// Total number of receive errors
	ResponseErrors metric.Int64Counter
	// Microseconds since last socket receive (or -1 if no receives yet for current connection).
	LastSocketReceive metric.Int64Counter
	// Number of connection attempts, including successful and failed, and name resolution failures.
	Connects metric.Int64Counter
	// Number of disconnects (triggered by broker, network, load-balancer, etc.).
	Disconnects metric.Int64Counter

	// Smallest value
	LatencyMin metric.Int64Gauge
	// Largest value
	LatencyMax metric.Int64Gauge
	// Average value
	LatencyAvg metric.Int64Gauge
	// Sum of values
	LatencySum metric.Int64Gauge
	// Standard deviation (based on histogram)
	LatencyStdDev metric.Int64Gauge
	// 50th percentile
	LatencyP50 metric.Int64Gauge
	// 75th percentile
	LatencyP75 metric.Int64Gauge
	// 90th percentile
	LatencyP90 metric.Int64Gauge
	// 95th percentile
	LatencyP95 metric.Int64Gauge
	// 99th percentile
	LatencyP99 metric.Int64Gauge
	// 99.99th percentile
	LatencyP9999 metric.Int64Gauge

	// Smallest value
	ThrottleMin metric.Int64Gauge
	// Largest value
	ThrottleMax metric.Int64Gauge
	// Average value
	ThrottleAvg metric.Int64Gauge
	// Sum of values
	ThrottleSum metric.Int64Gauge
	// Standard deviation (based on histogram)
	ThrottleStdDev metric.Int64Gauge
	// Memory size of Hdr Histogram
	ThrottleHdrSize metric.Int64Gauge
	// 50th percentile
	ThrottleP50 metric.Int64Gauge
	// 75th percentile
	ThrottleP75 metric.Int64Gauge
	// 90th percentile
	ThrottleP90 metric.Int64Gauge
	// 95th percentile
	ThrottleP95 metric.Int64Gauge
	// 99th percentile
	ThrottleP99 metric.Int64Gauge
	// 99.99th percentile
	ThrottleP9999 metric.Int64Gauge
}

func NewBrokerMetrics

func NewBrokerMetrics(meter metric.Meter) (*BrokerMetrics, error)

func (*BrokerMetrics) Add

func (m *BrokerMetrics) Add(ctx context.Context, stats *stats.BrokerStats, attrs ...attribute.KeyValue)

type ConsumerGroupMetrics

type ConsumerGroupMetrics struct {
	// Local consumer group handler's state
	State metric.Int64Gauge
	// Time elapsed since last state change (milliseconds)
	StateAge metric.Int64Gauge
	// Local consumer group handler's join state
	JoinState metric.Int64Gauge
	// Time elapsed since last rebalance (assign or revoke) (milliseconds)
	RebalanceAge metric.Int64Gauge
	// Total number of rebalances (assign or revoke)
	RebalanceCount metric.Int64Counter
	// Current assignment's partition count
	PartitionAssigned metric.Int64Gauge
}

func NewConsumerGroupMetrics

func NewConsumerGroupMetrics(meter metric.Meter) (*ConsumerGroupMetrics, error)

func (*ConsumerGroupMetrics) Add

type Metrics

type Metrics struct {
	*BrokerMetrics
	*TopicMetrics
	*ConsumerGroupMetrics

	// Time since this client instance was created (microseconds)
	Age metric.Int64Counter
	// Number of ops (callbacks, events, etc) waiting in queue for application to serve with rd_kafka_poll()
	ReplyQueue metric.Int64Gauge
	// Current number of messages in producer queues
	MessageCount metric.Int64Gauge
	// Current total size of messages in producer queues
	MessageSize metric.Int64Gauge
	// Total number of requests sent to Kafka brokers
	RequestsSent metric.Int64Counter
	// Total number of bytes transmitted to Kafka brokers
	RequestsBytesSent metric.Int64Counter
	// Total number of responses received from Kafka brokers
	RequestsReceived metric.Int64Counter
	// Total number of bytes received from Kafka brokers
	RequestsBytesReceived metric.Int64Counter
	// Total number of messages transmitted (produced) to Kafka brokers
	MessagesProduced metric.Int64Counter
	// Total number of message bytes (including framing, such as per-Message framing and MessageSet/batch framing) transmitted to Kafka brokers
	MessagesBytesProduced metric.Int64Counter
	// Total number of messages consumed, not including ignored messages (due to offset, etc), from Kafka brokers.
	MessagesConsumed metric.Int64Counter
	// Total number of message bytes (including framing) received from Kafka brokers
	MessagesBytesConsumed metric.Int64Counter
	// Number of topics in the metadata cache
	TopicsInMetadataCache metric.Int64Gauge
}

Metrics stores set of Kafka client related metrics See: https://github.com/confluentinc/librdkafka/blob/v2.4.0/STATISTICS.md

func New

func New(meter metric.Meter) (*Metrics, error)

func (*Metrics) Add

func (m *Metrics) Add(ctx context.Context, stats *stats.Stats, attrs ...attribute.KeyValue)

type PartitionMetrics

type PartitionMetrics struct {
	// The id of the broker that messages are currently being fetched from
	Broker metric.Int64Gauge
	// Current leader broker id
	Leader metric.Int64Gauge
	// Number of messages waiting to be produced in first-level queue
	MessagesInQueue metric.Int64Gauge
	// Number of bytes in first-level queue
	MessageBytesInQueue metric.Int64Gauge
	// Number of messages ready to be produced in transmit queue
	MessagesReadyToTransmit metric.Int64Gauge
	// Number of bytes in transmit queue
	MessageBytesReadyToTransmit metric.Int64Gauge
	// Number of pre-fetched messages in fetch queue
	MessagesInFetchQueue metric.Int64Gauge
	// Bytes in fetch queue
	MessageBytesInFetchQueue metric.Int64Gauge
	// Current/Last logical offset query
	QueryOffset metric.Int64Gauge
	// Next offset to fetch
	NextOffset metric.Int64Gauge
	// Offset of last message passed to application + 1
	AppOffset metric.Int64Gauge
	// Offset to be committed
	StoredOffset metric.Int64Gauge
	// Last committed offset
	CommittedOffset metric.Int64Gauge
	// Last PARTITION_EOF signaled offset
	EOFOffset metric.Int64Gauge
	// Partition's low watermark offset on broker
	LowWatermarkOffset metric.Int64Gauge
	// Partition's high watermark offset on broker
	HighWatermarkOffset metric.Int64Gauge
	// Partition's last stable offset on broker, or same as hi_offset is broker version is less than 0.11.0.0.
	LastStableOffsetOnBroker metric.Int64Gauge
	// Difference between (HighWatermarkOffset or LowWatermarkOffset) and CommittedOffset
	// HighWatermarkOffset is used when isolation.level=read_uncommitted, otherwise LowWatermarkOffset.
	ConsumerLag metric.Int64Gauge
	// Difference between (HighWatermarkOffset or LowWatermarkOffset) and StoredOffset. See ConsumerLag and StoredOffset.
	ConsumerLagStored metric.Int64Gauge
	// Total number of messages transmitted (produced)
	MessagesSent metric.Int64Counter
	// Total number of bytes transmitted
	MessageBytesSent metric.Int64Counter
	// Total number of messages consumed, not including ignored messages (due to offset, etc).
	MessagesReceived metric.Int64Counter
	// Total number of bytes received
	MessageBytesReceived metric.Int64Counter
	// Total number of messages received (consumer), or total number of messages produced (possibly not yet transmitted) (producer).
	TotalNumOfMessages metric.Int64Counter
	// Current number of messages in-flight to/from broker
	MessagesInflight metric.Int64Gauge
}

func NewPartitionMetrics

func NewPartitionMetrics(meter metric.Meter) (*PartitionMetrics, error)

func (*PartitionMetrics) Add

func (m *PartitionMetrics) Add(ctx context.Context, stats *stats.Partition, attrs ...attribute.KeyValue)

type TopicMetrics

type TopicMetrics struct {
	*PartitionMetrics

	// Age of client's topic object (milliseconds)
	Age metric.Int64Gauge `json:"age"`
	// Age of metadata from broker for this topic (milliseconds)
	MetadataAge metric.Int64Gauge `json:"metadata_age"`

	// Smallest value
	BatchSizeMin metric.Int64Gauge
	// Largest value
	BatchSizeMax metric.Int64Gauge
	// Average value
	BatchSizeAvg metric.Int64Gauge
	// Sum of values
	BatchSizeSum metric.Int64Gauge
	// Standard deviation (based on histogram)
	BatchSizeStdDev metric.Int64Gauge
	// 50th percentile
	BatchSizeP50 metric.Int64Gauge
	// 75th percentile
	BatchSizeP75 metric.Int64Gauge
	// 90th percentile
	BatchSizeP90 metric.Int64Gauge
	// 95th percentile
	BatchSizeP95 metric.Int64Gauge
	// 99th percentile
	BatchSizeP99 metric.Int64Gauge
	// 99.99th percentile
	BatchSizeP9999 metric.Int64Gauge

	// Smallest value
	BatchCountMin metric.Int64Gauge
	// Largest value
	BatchCountMax metric.Int64Gauge
	// Average value
	BatchCountAvg metric.Int64Gauge
	// Sum of values
	BatchCountSum metric.Int64Gauge
	// Standard deviation (based on histogram)
	BatchCountStdDev metric.Int64Gauge
	// Memory size of Hdr Histogram
	BatchCountHdrSize metric.Int64Gauge
	// 50th percentile
	BatchCountP50 metric.Int64Gauge
	// 75th percentile
	BatchCountP75 metric.Int64Gauge
	// 90th percentile
	BatchCountP90 metric.Int64Gauge
	// 95th percentile
	BatchCountP95 metric.Int64Gauge
	// 99th percentile
	BatchCountP99 metric.Int64Gauge
	// 99.99th percentile
	BatchCountP9999 metric.Int64Gauge
}

func NewTopicMetrics

func NewTopicMetrics(meter metric.Meter) (*TopicMetrics, error)

func (*TopicMetrics) Add

func (m *TopicMetrics) Add(ctx context.Context, stats *stats.TopicStats, attrs ...attribute.KeyValue)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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