metrics

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NilPluginServerMetrics

type NilPluginServerMetrics struct{}

NilPluginServerMetrics is a no-op implementation for when metrics are disabled

func (*NilPluginServerMetrics) HTTPMiddleware

func (n *NilPluginServerMetrics) HTTPMiddleware() echo.MiddlewareFunc

func (*NilPluginServerMetrics) RecordHTTPError

func (n *NilPluginServerMetrics) RecordHTTPError(method, path, status string)

func (*NilPluginServerMetrics) RecordHTTPRequest

func (n *NilPluginServerMetrics) RecordHTTPRequest(method, path, status string, duration float64)

All methods are no-ops - safe to call, do nothing

type NilTxIndexerMetrics

type NilTxIndexerMetrics struct{}

NilTxIndexerMetrics is a no-op implementation for when metrics are disabled

func (*NilTxIndexerMetrics) RecordIterationDuration

func (n *NilTxIndexerMetrics) RecordIterationDuration(chain common.Chain, duration float64)

func (*NilTxIndexerMetrics) RecordProcessing

func (n *NilTxIndexerMetrics) RecordProcessing(chain common.Chain)

func (*NilTxIndexerMetrics) RecordProcessingError

func (n *NilTxIndexerMetrics) RecordProcessingError(chain common.Chain, errorType string)

func (*NilTxIndexerMetrics) RecordRPCError

func (n *NilTxIndexerMetrics) RecordRPCError(chain common.Chain)

func (*NilTxIndexerMetrics) RecordTransactionStatus

func (n *NilTxIndexerMetrics) RecordTransactionStatus(chain common.Chain, status string)

All methods are no-ops - safe to call, do nothing

func (*NilTxIndexerMetrics) SetActiveTransactions

func (n *NilTxIndexerMetrics) SetActiveTransactions(chain common.Chain, status string, count float64)

func (*NilTxIndexerMetrics) SetChainHeight

func (n *NilTxIndexerMetrics) SetChainHeight(chain common.Chain, height float64)

func (*NilTxIndexerMetrics) SetLastProcessingTimestamp

func (n *NilTxIndexerMetrics) SetLastProcessingTimestamp(timestamp float64)

type PluginServerMetrics

type PluginServerMetrics interface {
	// HTTP metrics recording methods
	RecordHTTPRequest(method, path, status string, duration float64)
	RecordHTTPError(method, path, status string)

	// Middleware integration
	HTTPMiddleware() echo.MiddlewareFunc
}

PluginServerMetrics interface for collecting plugin server HTTP metrics

func NewNilPluginServerMetrics

func NewNilPluginServerMetrics() PluginServerMetrics

NewNilPluginServerMetrics creates a no-op metrics implementation

type Registry

type Registry interface {
	MustRegister(collectors ...prometheus.Collector)
}

Registry is an interface for metrics registries to avoid circular dependencies

type SchedulerMetrics

type SchedulerMetrics interface {
	// SetActivePolicies sets the total number of active policies
	SetActivePolicies(count float64)

	// SetStuckPolicies sets the number of policies with next_execution < now (stuck policies)
	SetStuckPolicies(count float64)
}

SchedulerMetrics interface for collecting scheduler metrics

type TxIndexerMetrics

type TxIndexerMetrics interface {
	// RecordTransactionStatus records a transaction status change
	RecordTransactionStatus(chain common.Chain, status string)

	// RecordProcessing records a processed transaction
	RecordProcessing(chain common.Chain)

	// RecordIterationDuration records the time spent in an iteration
	RecordIterationDuration(chain common.Chain, duration float64)

	// SetLastProcessingTimestamp sets the timestamp of the last processing run
	SetLastProcessingTimestamp(timestamp float64)

	// SetActiveTransactions sets the number of active transactions
	SetActiveTransactions(chain common.Chain, status string, count float64)

	// RecordProcessingError records a processing error
	RecordProcessingError(chain common.Chain, errorType string)

	// RecordRPCError records an RPC error
	RecordRPCError(chain common.Chain)

	// SetChainHeight sets the current block height for a chain
	SetChainHeight(chain common.Chain, height float64)
}

TxIndexerMetrics interface for collecting transaction indexer metrics

func NewNilTxIndexerMetrics

func NewNilTxIndexerMetrics() TxIndexerMetrics

NewNilTxIndexerMetrics creates a no-op metrics implementation

Jump to

Keyboard shortcuts

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