metrics

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: AGPL-3.0, AGPL-3.0-only Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BackupLastSuccessTimestamp = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "backup_last_success_timestamp",
		Help:      "Unix timestamp of the last successful backup.",
	}, []string{"engine", "cluster", "namespace", "repository"})

	BackupLastDurationSeconds = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "backup_last_duration_seconds",
		Help:      "Duration of the last backup in seconds.",
	}, []string{"engine", "cluster", "namespace", "repository"})

	BackupTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "backup_total",
		Help:      "Total number of backup operations.",
	}, []string{"engine", "cluster", "namespace", "repository", "status"})

	BackupSizeBytes = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "backup_size_bytes",
		Help:      "Size of the last backup in bytes.",
	}, []string{"engine", "cluster", "namespace", "repository"})
)
View Source
var (
	TriageLastRunTimestamp = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "triage_last_run_timestamp",
		Help:      "Unix timestamp of the last triage run.",
	}, []string{"engine", "cluster", "namespace"})

	TriageHealthyInstances = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "triage_healthy_instances",
		Help:      "Number of healthy instances after last triage.",
	}, []string{"engine", "cluster", "namespace"})

	TriageTotalInstances = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "triage_total_instances",
		Help:      "Total number of instances after last triage.",
	}, []string{"engine", "cluster", "namespace"})

	TriageResult = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "triage_result",
		Help:      "Last triage result (1=active). Labels: result=healthy|unhealthy|split_brain.",
	}, []string{"engine", "cluster", "namespace", "result"})
)
View Source
var (
	RepairTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "repair_total",
		Help:      "Total number of repair operations.",
	}, []string{"engine", "cluster", "namespace", "status"})

	RepairLastTimestamp = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "repair_last_timestamp",
		Help:      "Unix timestamp of the last repair.",
	}, []string{"engine", "cluster", "namespace"})
)
View Source
var (
	RepositorySnapshotCount = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "repository_snapshot_count",
		Help:      "Number of snapshots in a backup repository.",
	}, []string{"repository"})

	RepositoryTotalSizeBytes = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "repository_total_size_bytes",
		Help:      "Total size of a backup repository in bytes.",
	}, []string{"repository"})

	RepositoryDeduplicatedSizeBytes = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "repository_deduplicated_size_bytes",
		Help:      "Deduplicated size of a backup repository in bytes.",
	}, []string{"repository"})
)
View Source
var (
	ManagedDatabases = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: namespace,
		Name:      "managed_databases",
		Help:      "Number of databases managed by hasteward.",
	}, []string{"engine"})

	ControllerReconcileTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: namespace,
		Name:      "controller_reconcile_total",
		Help:      "Total number of controller reconciliation loops.",
	}, []string{"engine", "status"})
)

Functions

func RecordBackupFailure

func RecordBackupFailure(engine, cluster, ns, repo string)

RecordBackupFailure records metrics for a failed backup.

func RecordBackupSuccess

func RecordBackupSuccess(engine, cluster, ns, repo string, result *model.BackupResult)

RecordBackupSuccess records metrics for a successful backup.

func RecordManagedDatabases

func RecordManagedDatabases(engine string, count int)

RecordManagedDatabases updates the managed database count for an engine.

func RecordReconcile

func RecordReconcile(engine, status string)

RecordReconcile increments the reconcile counter.

func RecordRepairFailure

func RecordRepairFailure(engine, cluster, ns string)

RecordRepairFailure records metrics for a failed repair.

func RecordRepairSuccess

func RecordRepairSuccess(engine, cluster, ns string)

RecordRepairSuccess records metrics for a successful repair.

func RecordTriageResult

func RecordTriageResult(engine, cluster, ns string, result *model.TriageResult, triageStatus string)

RecordTriageResult records metrics for a triage operation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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