metrics

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package metrics defines Prometheus metrics for the Janus transaction controller. Import this package (blank import) to register metrics on the controller-runtime registry.

Index

Constants

This section is empty.

Variables

View Source
var (
	// PhaseTransitions counts state machine edge traversals.
	PhaseTransitions = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "janus_transaction_phase_transitions_total",
		Help: "Number of transaction phase transitions.",
	}, []string{"from_phase", "to_phase"})

	// Duration observes wall-clock time from StartedAt to CompletedAt by terminal outcome.
	Duration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:    "janus_transaction_duration_seconds",
		Help:    "Transaction duration from start to completion.",
		Buckets: prometheus.ExponentialBuckets(1, 2, 12),
	}, []string{"outcome"})

	// ActiveTransactions tracks in-flight transactions per non-terminal phase.
	ActiveTransactions = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "janus_transactions_active",
		Help: "Number of in-flight transactions per phase.",
	}, []string{"phase"})

	// ItemOperations counts per-item prepare/commit/rollback results.
	ItemOperations = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "janus_item_operations_total",
		Help: "Per-item operation outcomes.",
	}, []string{"operation", "result"})

	// LockOperations counts lock acquire/renew/release results.
	LockOperations = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "janus_lock_operations_total",
		Help: "Lock operation outcomes.",
	}, []string{"operation", "result"})

	// ItemCount observes the distribution of items per transaction.
	ItemCount = prometheus.NewHistogram(prometheus.HistogramOpts{
		Name:    "janus_transaction_item_count",
		Help:    "Number of items per transaction.",
		Buckets: prometheus.LinearBuckets(1, 1, 10),
	})
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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