Prometheus instrumentation for the wavelength daemon (waved). All
metrics are namespaced under waved_. Mirrors the lumosd server metrics
package (one directory up) in structure and collection strategy: an
event-driven actor for lifecycle counters, plus a scrape-time collector for
gauges that must stay fresh (VTXO inventory, wallet balance, chain tip, live
OOR/round state).
MetricsActor/ActorConfig— event-driven counters.wavedspawns a small pool of these (metricsActorWorkers = 4, inwaved/metrics.go) registered underActorKey; the actor holds no mutable state, so any worker can handle any message.Msg— sealed interface for actor messages:BoardingEventMsg,RoundJoinedMsg,RoundCompletedMsg,OORTransferReceivedMsg,OORTransferSentMsg,BackgroundTaskErrorMsg.Sink(= actor.TellOnlyRef[Msg]) /NewSink— fire-and-forget handle resolved from the actor system viaActorKey, which round-robins Tells across the worker pool.SystemCollector/SystemStatsQuerier—prometheus.Collectorthat queries live client state on each scrape (VTXO inventory/value, wallet balance, block height,oor_sessions_by_state,rounds_by_status). Each querier method is collected independently; an error only suppresses that method's gauges for the scrape.Server/ServerConfig— opt-in HTTP/metricsendpoint; disabled unlessServerConfig.ListenAddris set.GRPCClientMetrics— sharedgo-grpc-middleware/providers/prometheusClientMetrics, installed as interceptors on the operator gRPC connection.
- Depends on:
baselib/actor(actor framework,Sink),btclog,lnd/fn/v2,client_golang/prometheus,go-grpc-middleware/providers/prometheus. - Depended on by:
waved(spawns the actor pool, ownsSystemCollectoradapter and HTTP server, emitsBoardingEventMsg/OORTransferSentMsgetc. directly),round(RoundClientConfig.MetricsSinkemitsRoundJoinedMsg/RoundCompletedMsg),wallet(WithMetricsSinkemitsBackgroundTaskErrorMsgfrom the boarding-sweep watcher),vtxo(IncomingVTXOHandlerConfig.MetricsSinkemitsOORTransferReceivedMsg). - Messages to/from: Receives
Msg(BoardingEventMsg,RoundJoinedMsg,RoundCompletedMsg,OORTransferReceivedMsg,OORTransferSentMsg,BackgroundTaskErrorMsg) <-round,wallet,vtxo,waved.
- All event-driven updates go through
MetricsActor.Receive; counters live in package-level Prometheus vectors, not actor state, so the worker pool is safe for concurrent delivery. - Scrape-driven gauges are collected by
SystemCollectorat scrape time, not by the actor. - The metrics server is opt-in: empty
ServerConfig.ListenAddrdisables the HTTP server, actor spawn, and collector registration. RegisterAllusesRegister+ toleratesAlreadyRegisteredError, notMustRegister(multiple daemons may share a process in tests).- Non-counter metrics must not use the
_totalsuffix (promlinter enforced). - Emission never blocks or fails the operation being recorded: emit sites
Tell through an
fn.Option[Sink]and only debug-log a Tell error.
- README.md — Full metrics reference table (names, types, labels, status enum values) for building Grafana dashboards.
- ARCHITECTURE.md — System-wide package map.