metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package metrics is the kit's Prometheus instrument set: the full contracts/metrics.md contract (T007 skeleton + T066 completion) — the PRD §31.1 names verbatim plus the operational extras, all carrying chain_id.

Metric names are a published contract (PRD §31.1); renaming is breaking. Gauges that mirror storage state (review-queue depth, open chain-review conditions, controls, deposit backlog, hot-wallet balances) are refreshed by the reconciler service's gauge loop — other services never need to emit them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set struct {
	Registry *prometheus.Registry

	ScannerLatestChainHeight   *prometheus.GaugeVec   // chain_id
	ScannerLastProcessedHeight *prometheus.GaugeVec   // chain_id
	ScannerHeightLag           *prometheus.GaugeVec   // chain_id
	ScannerBlocksProcessed     *prometheus.CounterVec // chain_id
	DepositsDiscovered         *prometheus.CounterVec // chain_id
	DepositsCredited           *prometheus.CounterVec // chain_id
	DuplicateDeposits          *prometheus.CounterVec // chain_id
	WithdrawalsRequested       *prometheus.CounterVec // chain_id
	WithdrawalsBroadcast       *prometheus.CounterVec // chain_id
	WithdrawalsConfirmed       *prometheus.CounterVec // chain_id
	WithdrawalsFailed          *prometheus.CounterVec // chain_id, stage
	SequenceMismatch           *prometheus.CounterVec // chain_id
	RPCErrors                  *prometheus.CounterVec // chain_id, endpoint
	GRPCErrors                 *prometheus.CounterVec // chain_id, endpoint
	ReconciliationDiscrepancy  *prometheus.CounterVec // chain_id
	HotWalletBalanceUsovr      *prometheus.GaugeVec   // chain_id, address

	// Operational extras (contracts/metrics.md — same stability guarantee).
	ReviewQueueDepth          *prometheus.GaugeVec   // chain_id
	ChainReviewConditionsOpen *prometheus.GaugeVec   // chain_id, trigger
	ControlsPaused            *prometheus.GaugeVec   // chain_id, flow (1 = paused)
	SweepsDeferred            *prometheus.CounterVec // chain_id
	FeeFundingUsovr           *prometheus.CounterVec // chain_id (FEE_FUND funding legs confirmed)
	DepositBacklog            *prometheus.GaugeVec   // chain_id (CREDITABLE not yet CREDITED)
	BuildInfo                 *prometheus.GaugeVec   // version, commit

	// Alert-pack inputs not yet wired to a live source: UpgradePlanHeight is
	// set by the adapter's upgrade-plan poll once the client exposes the
	// x/upgrade query; UnsupportedBinaryVersion flips to 1 on a
	// manifest/app-version mismatch. Both stay absent (never scraped as 0)
	// until their producers emit them, so their alerts cannot false-fire.
	UpgradePlanHeight        *prometheus.GaugeVec // chain_id
	UnsupportedBinaryVersion *prometheus.GaugeVec // chain_id
}

Set holds the kit's registered instruments. One Set per adapter process.

func NewSet

func NewSet() *Set

NewSet builds a fresh registry with the core instrument set.

func (*Set) Handler

func (s *Set) Handler() http.Handler

Handler returns the Prometheus exposition handler for the adapter's :9464/metrics listener (contracts/metrics.md).

Jump to

Keyboard shortcuts

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