metrics

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FailedPartsCount = prometheus.NewCounter(prometheus.CounterOpts{
	Namespace: "clickhouse_backup",
	Name:      "failed_parts_count",
	Help:      "Counter of data parts skipped as broken during backup creation with max_broken_part_ratio > 0",
})

FailedPartsCount counts data parts skipped as broken during backup creation when general.max_broken_part_ratio > 0 tolerated them. It is a package-level counter because it is incremented from pkg/backup (which has no APIMetrics instance) and registered in RegisterMetrics, see https://github.com/Altinity/clickhouse-backup/issues/1418

Functions

This section is empty.

Types

type APIMetrics

type APIMetrics struct {
	SuccessfulCounter map[string]prometheus.Counter
	FailedCounter     map[string]prometheus.Counter
	LastStart         map[string]prometheus.Gauge
	LastFinish        map[string]prometheus.Gauge
	LastDuration      map[string]prometheus.Gauge
	LastStatus        map[string]prometheus.Gauge

	LastBackupSizeLocal         prometheus.Gauge
	LastBackupSizeRemote        prometheus.Gauge
	NumberBackupsRemote         prometheus.Gauge
	NumberBackupsRemoteBroken   prometheus.Gauge
	NumberBackupsLocal          prometheus.Gauge
	NumberBackupsRemoteExpected prometheus.Gauge
	NumberBackupsLocalExpected  prometheus.Gauge
	InProgressCommands          prometheus.Gauge
	LocalDataSize               prometheus.Gauge

	SubCommands map[string][]string
}

func NewAPIMetrics

func NewAPIMetrics() *APIMetrics

func (*APIMetrics) ExecuteWithMetrics

func (m *APIMetrics) ExecuteWithMetrics(command string, errCounter int, f func() error) (error, int)

func (*APIMetrics) Failure

func (m *APIMetrics) Failure(command string)

func (*APIMetrics) Finish

func (m *APIMetrics) Finish(command string, startTime time.Time)

func (*APIMetrics) RegisterMetrics

func (m *APIMetrics) RegisterMetrics()

RegisterMetrics resister prometheus metrics and define allowed measured commands list

func (*APIMetrics) Start

func (m *APIMetrics) Start(command string, startTime time.Time)

func (*APIMetrics) Success

func (m *APIMetrics) Success(command string)

Jump to

Keyboard shortcuts

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