diff --git a/routing/control_tower.go b/routing/control_tower.go index 8968ca312..7fc794763 100644 --- a/routing/control_tower.go +++ b/routing/control_tower.go @@ -5,6 +5,7 @@ import ( "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/lntypes" + "github.com/lightningnetwork/lnd/monitoring" "github.com/lightningnetwork/lnd/multimutex" "github.com/lightningnetwork/lnd/queue" ) @@ -191,6 +192,9 @@ func (p *controlTower) InitPayment(paymentHash lntypes.Hash, return err } + // Observe the creation of a new payment. + monitoring.IncrementPaymentCount() + // Take lock before querying the db to prevent missing or duplicating // an update. p.paymentsMtx.Lock(paymentHash) diff --git a/routing/payment_lifecycle.go b/routing/payment_lifecycle.go index 9a7414079..db61c064b 100644 --- a/routing/payment_lifecycle.go +++ b/routing/payment_lifecycle.go @@ -15,6 +15,7 @@ import ( "github.com/lightningnetwork/lnd/htlcswitch" "github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/lnwire" + "github.com/lightningnetwork/lnd/monitoring" "github.com/lightningnetwork/lnd/routing/route" "github.com/lightningnetwork/lnd/routing/shards" "github.com/lightningnetwork/lnd/tlv" @@ -596,6 +597,9 @@ func (p *paymentLifecycle) registerAttempt(rt *route.Route, p.identifier, &attempt.HTLCAttemptInfo, ) + // Observe a new HTLC attempt for the payment. + monitoring.IncrementHTLCAttemptCount() + return attempt, err }