metrics

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricNamespace is the common namespace for all ClearNode metrics.
	MetricNamespace = "clearnode"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionResult

type ActionResult string
const (
	ActionResultSuccess ActionResult = "success"
	ActionResultFailed  ActionResult = "failed"
)

func (ActionResult) String

func (res ActionResult) String() string

type RuntimeMetricExporter

type RuntimeMetricExporter interface {
	// Shared
	IncUserState(asset string, homeBlockchainID uint64, transition core.TransitionType)  // +
	RecordTransaction(asset string, txType core.TransactionType, amount decimal.Decimal) // +
	IncChannelStateSigValidation(sigType core.ChannelSignerType, success bool)           // +
	IncChannelSessionKeys()                                                              // +
	IncAppSessionKeys()                                                                  // +

	// api/rpc_router
	IncRPCMessage(msgType rpc.MsgType, method string)                                 // +
	IncRPCRequest(method, path string, success bool)                                  // +
	ObserveRPCDuration(method, path string, success bool, durationSecs time.Duration) // +
	SetRPCConnections(region, origin string, count uint32)                            // +

	// api/app_session_v1
	IncAppStateUpdate(applicationID string)                                                                  // +
	IncAppSessionUpdateSigValidation(applicationID string, sigType app.AppSessionSignerTypeV1, success bool) // +

	// Blockchain Worker
	IncBlockchainAction(asset string, blockchainID uint64, actionType string, success bool) // +

	// Event Listener
	IncBlockchainEvent(blockchainID uint64, handledSuccessfully bool) // +
}

RuntimeMetricExporter defines the interface for recording runtime metrics across various components of the system.

func NewNoopRuntimeMetricExporter

func NewNoopRuntimeMetricExporter() RuntimeMetricExporter

func NewRuntimeMetricExporter

func NewRuntimeMetricExporter(reg prometheus.Registerer) (RuntimeMetricExporter, error)

RuntimeMetricExporter exposes metrics related to runtime operations, such as API requests, channel state validations, and blockchain interactions.

type StoreMetricExporter

type StoreMetricExporter interface {
	SetAppSessions(applicationID string, status app.AppSessionStatus, count uint64)
	SetChannels(asset string, status core.ChannelStatus, count uint64)
	SetActiveUsers(asset, timeSpanLabel string, count uint64)
	SetActiveAppSessions(applicationID, timeSpanLabel string, count uint64)
	SetTotalValueLocked(domain, asset string, value float64)
}

StoreMetricExporter defines the interface for setting metrics that are stored and updated by a separate metric worker.

func NewStoreMetricExporter

func NewStoreMetricExporter(reg prometheus.Registerer) (StoreMetricExporter, error)

Jump to

Keyboard shortcuts

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