telemetry

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogSampler

type LogSampler struct {
	// contains filtered or unexported fields
}

LogSampler gates log emission so that at most one log is emitted per interval for each unique key. Callers use Allow() to check whether a log should be written; suppressed occurrences are counted and reported when the next log is allowed.

Keys should be bounded (e.g. event names, table names, topic names) so that the internal map does not grow unboundedly.

func NewLogSampler

func NewLogSampler(interval time.Duration) *LogSampler

NewLogSampler creates a sampler that allows one log per interval per key.

func (*LogSampler) Allow

func (s *LogSampler) Allow(key string) (allowed bool, suppressed int64)

Allow returns whether a log should be emitted for the given key, and the number of occurrences suppressed since the last emission.

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

Metrics holds all Prometheus metrics for the ClickHouse writer/router stack.

Used by both consumoor (subsystem="consumoor") and cannon's direct-CH sink (subsystem="cannon"). Some metric labels (kafka_*, dlq_*, topic) are only populated by Kafka-based callers; cannon does not emit those.

func NewMetrics

func NewMetrics(namespace, subsystem string) *Metrics

NewMetrics creates and registers all ClickHouse stack Prometheus metrics under the given namespace + subsystem (e.g. "xatu" + "consumoor", or "xatu" + "cannon" for the direct-CH sink).

Calls with the same (namespace, subsystem) return the same *Metrics instance — promauto registers metrics globally, so a second call would otherwise panic on duplicate registration. This lets multiple writer instances share one set of metric vectors keyed by their subsystem.

An empty subsystem falls back to "clickhouse" — callers should set this explicitly so dashboards and alerts can distinguish per-binary metrics.

func (*Metrics) ActiveTopics

func (m *Metrics) ActiveTopics() prometheus.Gauge

func (*Metrics) AdaptiveLimiterInflight

func (m *Metrics) AdaptiveLimiterInflight() *prometheus.GaugeVec

func (*Metrics) AdaptiveLimiterLimit

func (m *Metrics) AdaptiveLimiterLimit() *prometheus.GaugeVec

func (*Metrics) AdaptiveLimiterQueued

func (m *Metrics) AdaptiveLimiterQueued() *prometheus.GaugeVec

func (*Metrics) AdaptiveLimiterRejections

func (m *Metrics) AdaptiveLimiterRejections() *prometheus.CounterVec

func (*Metrics) BatchFlushTrigger

func (m *Metrics) BatchFlushTrigger() *prometheus.CounterVec

func (*Metrics) BatchSize

func (m *Metrics) BatchSize() *prometheus.HistogramVec

func (*Metrics) ChgoPoolAcquireDuration

func (m *Metrics) ChgoPoolAcquireDuration() prometheus.Gauge

func (*Metrics) ChgoPoolAcquireTotal

func (m *Metrics) ChgoPoolAcquireTotal() prometheus.Counter

func (*Metrics) ChgoPoolAcquiredResources

func (m *Metrics) ChgoPoolAcquiredResources() prometheus.Gauge

func (*Metrics) ChgoPoolCanceledAcquireTotal

func (m *Metrics) ChgoPoolCanceledAcquireTotal() prometheus.Counter

func (*Metrics) ChgoPoolConstructingResources

func (m *Metrics) ChgoPoolConstructingResources() prometheus.Gauge

func (*Metrics) ChgoPoolEmptyAcquireTotal

func (m *Metrics) ChgoPoolEmptyAcquireTotal() prometheus.Counter

func (*Metrics) ChgoPoolEmptyAcquireWaitTime

func (m *Metrics) ChgoPoolEmptyAcquireWaitTime() prometheus.Gauge

func (*Metrics) ChgoPoolIdleResources

func (m *Metrics) ChgoPoolIdleResources() prometheus.Gauge

func (*Metrics) ChgoPoolMaxResources

func (m *Metrics) ChgoPoolMaxResources() prometheus.Gauge

func (*Metrics) ChgoPoolTotalResources

func (m *Metrics) ChgoPoolTotalResources() prometheus.Gauge

func (*Metrics) DLQErrors

func (m *Metrics) DLQErrors() *prometheus.CounterVec

func (*Metrics) DLQWrites

func (m *Metrics) DLQWrites() *prometheus.CounterVec

func (*Metrics) DecodeErrors

func (m *Metrics) DecodeErrors() *prometheus.CounterVec

func (*Metrics) EventLag

func (m *Metrics) EventLag() *prometheus.HistogramVec

func (*Metrics) FlattenErrors

func (m *Metrics) FlattenErrors() *prometheus.CounterVec

func (*Metrics) GroupRetries

func (m *Metrics) GroupRetries() *prometheus.CounterVec

func (*Metrics) KafkaConsumerLag

func (m *Metrics) KafkaConsumerLag() *prometheus.GaugeVec

func (*Metrics) MessagesConsumed

func (m *Metrics) MessagesConsumed() *prometheus.CounterVec

func (*Metrics) MessagesDropped

func (m *Metrics) MessagesDropped() *prometheus.CounterVec

func (*Metrics) MessagesRejected

func (m *Metrics) MessagesRejected() *prometheus.CounterVec

func (*Metrics) MessagesRouted

func (m *Metrics) MessagesRouted() *prometheus.CounterVec

func (*Metrics) OutputMaxInFlight

func (m *Metrics) OutputMaxInFlight() *prometheus.GaugeVec

func (*Metrics) RowsWritten

func (m *Metrics) RowsWritten() *prometheus.CounterVec

func (*Metrics) WriteDuration

func (m *Metrics) WriteDuration() *prometheus.HistogramVec

func (*Metrics) WriteErrors

func (m *Metrics) WriteErrors() *prometheus.CounterVec

func (*Metrics) WriteRetries

func (m *Metrics) WriteRetries() *prometheus.CounterVec

Jump to

Keyboard shortcuts

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