metrics

package
v1.32.21 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReplicationEngineCallbacks

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

ReplicationEngineCallbacks contains a set of callback functions that are invoked during the lifecycle of the replication engine and its internal components.

These callbacks allow external systems to react to state transitions in the engine, producer, and consumer.

func NewReplicationEngineCallbacks

func NewReplicationEngineCallbacks(reg prometheus.Registerer) *ReplicationEngineCallbacks

NewReplicationEngineCallbacks creates and registers Prometheus metrics to track the lifecycle status of the replication engine and its internal components.

It returns an ReplicationEngineCallbacks instance that updates the following metrics: - weaviate_replication_engine_running_status (GaugeVec) - weaviate_replication_engine_producer_running_status (GaugeVec) - weaviate_replication_engine_consumer_running_status (GaugeVec)

All metrics are labeled by node and reflect the current running state: - 1 = running - 0 = not running

This provides visibility into whether the engine, producer, or consumer is currently active on a per-node basis.

func (*ReplicationEngineCallbacks) OnConsumerStart

func (m *ReplicationEngineCallbacks) OnConsumerStart(node string)

OnConsumerStart invokes the configured callback for when the consumer starts.

func (*ReplicationEngineCallbacks) OnConsumerStop

func (m *ReplicationEngineCallbacks) OnConsumerStop(node string)

OnConsumerStop invokes the configured callback for when the consumer stops.

func (*ReplicationEngineCallbacks) OnEngineStart

func (m *ReplicationEngineCallbacks) OnEngineStart(node string)

OnEngineStart invokes the configured callback for when the engine starts.

func (*ReplicationEngineCallbacks) OnEngineStop

func (m *ReplicationEngineCallbacks) OnEngineStop(node string)

OnEngineStop invokes the configured callback for when the engine stops.

func (*ReplicationEngineCallbacks) OnProducerStart

func (m *ReplicationEngineCallbacks) OnProducerStart(node string)

OnProducerStart invokes the configured callback for when the producer starts.

func (*ReplicationEngineCallbacks) OnProducerStop

func (m *ReplicationEngineCallbacks) OnProducerStop(node string)

OnProducerStop invokes the configured callback for when the producer stops.

type ReplicationEngineCallbacksBuilder

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

ReplicationEngineCallbacksBuilder helps construct an ReplicationEngineCallbacks instance by allowing selective customization of lifecycle hooks.

All callbacks default to no-ops unless explicitly overridden.

func NewReplicationEngineCallbacksBuilder

func NewReplicationEngineCallbacksBuilder() *ReplicationEngineCallbacksBuilder

NewReplicationEngineCallbacksBuilder initializes a new ReplicationEngineCallbacksBuilder with default no-op functions for all lifecycle callbacks.

func (*ReplicationEngineCallbacksBuilder) Build

Build finalizes the builder and returns the ReplicationEngineCallbacks instance.

func (*ReplicationEngineCallbacksBuilder) WithConsumerStartCallback

func (b *ReplicationEngineCallbacksBuilder) WithConsumerStartCallback(callback func(node string)) *ReplicationEngineCallbacksBuilder

WithConsumerStartCallback sets the callback to be executed when the replication engine's consumer starts.

func (*ReplicationEngineCallbacksBuilder) WithConsumerStopCallback

func (b *ReplicationEngineCallbacksBuilder) WithConsumerStopCallback(callback func(node string)) *ReplicationEngineCallbacksBuilder

WithConsumerStopCallback sets the callback to be executed when the replication engine's consumer stops.

func (*ReplicationEngineCallbacksBuilder) WithEngineStartCallback

func (b *ReplicationEngineCallbacksBuilder) WithEngineStartCallback(callback func(node string)) *ReplicationEngineCallbacksBuilder

WithEngineStartCallback sets the callback to be executed when the replication engine starts.

func (*ReplicationEngineCallbacksBuilder) WithEngineStopCallback

func (b *ReplicationEngineCallbacksBuilder) WithEngineStopCallback(callback func(node string)) *ReplicationEngineCallbacksBuilder

WithEngineStopCallback sets the callback to be executed when the replication engine stops.

func (*ReplicationEngineCallbacksBuilder) WithProducerStartCallback

func (b *ReplicationEngineCallbacksBuilder) WithProducerStartCallback(callback func(node string)) *ReplicationEngineCallbacksBuilder

WithProducerStartCallback sets the callback to be executed when the replication engine's producer starts.

func (*ReplicationEngineCallbacksBuilder) WithProducerStopCallback

func (b *ReplicationEngineCallbacksBuilder) WithProducerStopCallback(callback func(node string)) *ReplicationEngineCallbacksBuilder

WithProducerStopCallback sets the callback to be executed when the replication engine's producer stops.

type ReplicationEngineOpsCallbacks

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

ReplicationEngineOpsCallbacks contains a set of callback functions that are invoked on different stages of a replication operation's lifecycle.

func NewReplicationEngineOpsCallbacks

func NewReplicationEngineOpsCallbacks(reg prometheus.Registerer) *ReplicationEngineOpsCallbacks

NewReplicationEngineOpsCallbacks creates and registers Prometheus metrics for tracking replication operations and returns a ReplicationEngineOpsCallbacks instance configured to update those metrics.

The following metrics are registered with the provided registerer: - weaviate_replication_pending_operations (GaugeVec) - weaviate_replication_ongoing_operations (GaugeVec) - weaviate_replication_complete_operations (CounterVec) - weaviate_replication_failed_operations (CounterVec) - weaviate_replication_cancelled_operations (CounterVec)

All metrics are labeled by node and automatically updated through the callback lifecycle.

The operation lifecycle and corresponding metric updates are as follows: 1. When an operation is **registered as pending**, increment `replication_pending_operations`. 2. When (and if) an operations is **skipped** (cancelled before starting), decrement `replication_pending_operations`. 3. When an operation **starts**, decrement `replication_pending_operations` and increment `replication_ongoing_operations`. 4. When an operation **completes successfully**, decrement `replication_ongoing_operations` and increment `replication_complete_operations`. 5. When an operation **fails**, decrement `replication_ongoing_operations` and increment `replication_failed_operations`.

This ensures that gauges (`pending`, `ongoing`) reflect the current number of active operations, while counters (`complete`, `failed`) accumulate totals over time.

func (*ReplicationEngineOpsCallbacks) OnOpCancelled

func (m *ReplicationEngineOpsCallbacks) OnOpCancelled(node string)

OnOpCancelled invokes the configured callback for when a replication operation is cancelled.

func (*ReplicationEngineOpsCallbacks) OnOpComplete

func (m *ReplicationEngineOpsCallbacks) OnOpComplete(node string)

OnOpComplete invokes the configured callback for when a replication operation completes successfully.

func (*ReplicationEngineOpsCallbacks) OnOpFailed

func (m *ReplicationEngineOpsCallbacks) OnOpFailed(node string)

OnOpFailed invokes the configured callback for when a replication operation fails.

func (*ReplicationEngineOpsCallbacks) OnOpPending

func (m *ReplicationEngineOpsCallbacks) OnOpPending(node string)

OnOpPending invokes the configured callback for when a replication operation becomes pending.

func (*ReplicationEngineOpsCallbacks) OnOpSkipped

func (m *ReplicationEngineOpsCallbacks) OnOpSkipped(node string)

OnOpSkipped invokes the configured callback when a replication operation is skipped

func (*ReplicationEngineOpsCallbacks) OnOpStart

func (m *ReplicationEngineOpsCallbacks) OnOpStart(node string)

OnOpStart invokes the configured callback for when a replication operation starts.

func (*ReplicationEngineOpsCallbacks) OnPrepareProcessing

func (m *ReplicationEngineOpsCallbacks) OnPrepareProcessing(node string)

type ReplicationEngineOpsCallbacksBuilder

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

ReplicationEngineOpsCallbacksBuilder helps construct an ReplicationEngineOpsCallbacks instance with custom behavior for each stage of a replication operation.

func NewReplicationEngineOpsCallbacksBuilder

func NewReplicationEngineOpsCallbacksBuilder() *ReplicationEngineOpsCallbacksBuilder

NewReplicationEngineOpsCallbacksBuilder initializes a new ReplicationEngineOpsCallbacksBuilder with no-op default callbacks.

func (*ReplicationEngineOpsCallbacksBuilder) Build

Build finalizes the configuration and returns the ReplicationEngineOpsCallbacks instance.

func (*ReplicationEngineOpsCallbacksBuilder) WithOpCancelledCallback

func (b *ReplicationEngineOpsCallbacksBuilder) WithOpCancelledCallback(callback func(node string)) *ReplicationEngineOpsCallbacksBuilder

WithOpCancelledCallback sets a callback to be executed when a replication operation is cancelled for the given node.

func (*ReplicationEngineOpsCallbacksBuilder) WithOpCompleteCallback

func (b *ReplicationEngineOpsCallbacksBuilder) WithOpCompleteCallback(callback func(node string)) *ReplicationEngineOpsCallbacksBuilder

WithOpCompleteCallback sets a callback to be executed when a replication operation completes successfully for the given node.

func (*ReplicationEngineOpsCallbacksBuilder) WithOpFailedCallback

func (b *ReplicationEngineOpsCallbacksBuilder) WithOpFailedCallback(callback func(node string)) *ReplicationEngineOpsCallbacksBuilder

WithOpFailedCallback sets a callback to be executed when a replication operation fails for the given node.

func (*ReplicationEngineOpsCallbacksBuilder) WithOpPendingCallback

func (b *ReplicationEngineOpsCallbacksBuilder) WithOpPendingCallback(callback func(node string)) *ReplicationEngineOpsCallbacksBuilder

WithOpPendingCallback sets a callback to be executed when a replication operation becomes pending for the given node.

func (*ReplicationEngineOpsCallbacksBuilder) WithOpSkippedCallback

func (b *ReplicationEngineOpsCallbacksBuilder) WithOpSkippedCallback(callback func(node string)) *ReplicationEngineOpsCallbacksBuilder

WithOpSkippedCallback sets a callback to be executed when a replication operation is skipped because already running or completed execution (successfully or with a failure)

func (*ReplicationEngineOpsCallbacksBuilder) WithOpStartCallback

func (b *ReplicationEngineOpsCallbacksBuilder) WithOpStartCallback(callback func(node string)) *ReplicationEngineOpsCallbacksBuilder

WithOpStartCallback sets a callback to be executed when a replication operation starts processing for the given node.

func (*ReplicationEngineOpsCallbacksBuilder) WithPrepareProcessing

func (b *ReplicationEngineOpsCallbacksBuilder) WithPrepareProcessing(callback func(node string)) *ReplicationEngineOpsCallbacksBuilder

WithPrepareProcessing sets a callback to be executed before starting to process replication operations for a given node. This can be used to initialize metrics like counters and gauges to ensure they are exposed with an initial value, avoiding gaps when the engine starts.

Jump to

Keyboard shortcuts

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