metrics

package
v0.0.0-...-361bf8e Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConsumerLag is a metric for how far behind the consumer is
	// based on the last consumed event
	ConsumerLag = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: "reflex",
		Subsystem: "consumer",
		Name:      "lag_seconds",
		Help:      "Lag between now and the current event timestamp in seconds",
	}, []string{consumerLabel})

	// ConsumerAge is a metric for how old events coming that are being
	// processed are.
	ConsumerAge = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: "reflex",
		Subsystem: "consumer",
		Name:      "event_age_seconds",
		Help:      "The age of events that are being processed by the consumer",
		Buckets: []float64{
			0.1, .5, 1, 5,
			10, 50, 100, 500,
			1_000, 10_000, 50_000,
			100_000,
		},
	}, []string{consumerLabel})

	// ConsumerLagAlert is whether or not the consumer is too far behind
	ConsumerLagAlert = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: "reflex",
		Subsystem: "consumer",
		Name:      "lag_alert",
		Help:      "Whether or not the consumer lag crosses its alert threshold",
	}, []string{consumerLabel})

	// ConsumerActivityGauge is whether or not the consumer has processed an event
	ConsumerActivityGauge = newActivityGauge(
		prometheus.NewGaugeVec(prometheus.GaugeOpts{
			Namespace: "reflex",
			Subsystem: "consumer",
			Name:      "active",
			Help: "Whether or not the consumer was active (consumed an event) " +
				"in the activity ttl period",
		}, []string{consumerLabel}))

	// ConsumerLatency is how long the consumer is taking to process an event
	ConsumerLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: "reflex",
		Subsystem: "consumer",
		Name:      "latency_seconds",
		Help:      "Event loop latency in seconds",
		Buckets:   []float64{0.01, 0.1, 1, 5, 10, 60, 300},
	}, []string{consumerLabel})

	// ConsumerErrors is the number of errors from processing events
	ConsumerErrors = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: "reflex",
		Subsystem: "consumer",
		Name:      "error_count",
		Help:      "Number of errors processing events",
	}, []string{consumerLabel})

	// ConsumerSkippedEvents is the number of events skipped by consumer
	ConsumerDeadLetteredEvents = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "reflex_consumer_dead_lettered_events_count",
		Help: "Number of events dead lettered by consumer",
	}, []string{consumerLabel})

	// ConsumerSkippedEvents is the number of events skipped by consumer
	ConsumerSkippedEvents = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "reflex_consumer_skipped_events_count",
		Help: "Number of events skipped by consumer",
	}, []string{consumerLabel})
)

Functions

func Labels

func Labels(name string) prometheus.Labels

Labels returns the prometheus labels for the consumer

Types

This section is empty.

Jump to

Keyboard shortcuts

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