@@ -30,6 +30,7 @@ import fr.acinq.eclair.db.DbEventHandler.ChannelEvent
3030import fr .acinq .eclair .payment .Monitoring .{Metrics => PaymentMetrics , Tags => PaymentTags }
3131import fr .acinq .eclair .payment ._
3232import fr .acinq .eclair .{Logs , NodeParams , TimestampMilli }
33+ import kamon .tag .TagSet
3334
3435/**
3536 * This actor sits at the interface between our event stream and the database.
@@ -112,10 +113,17 @@ class DbEventHandler(nodeParams: NodeParams) extends Actor with DiagnosticActorL
112113 // The first pattern matching level is to ignore some errors, the second level is to separate between different kind of errors.
113114 e.error match {
114115 case LocalError (_ : CannotAffordFees ) => () // will be thrown at each new block if our balance is too low to update the commitment fee
115- case _ => e.error match {
116- case LocalError (_) => ChannelMetrics .ChannelErrors .withTag(ChannelTags .Origin , ChannelTags .Origins .Local ).withTag(ChannelTags .Fatal , value = e.isFatal).increment()
117- case RemoteError (_) => ChannelMetrics .ChannelErrors .withTag(ChannelTags .Origin , ChannelTags .Origins .Remote ).increment()
118- }
116+ case _ =>
117+ val tags = e.error match {
118+ case LocalError (t) => TagSet .Empty
119+ .withTag(ChannelTags .Origin , ChannelTags .Origins .Local )
120+ .withTag(ChannelTags .Fatal , value = e.isFatal)
121+ .withTag(ChannelTags .ErrorType , t.getClass.getSimpleName)
122+ case RemoteError (_) => TagSet .Empty
123+ .withTag(ChannelTags .Origin , ChannelTags .Origins .Remote )
124+ .withTag(ChannelTags .Fatal , value = true ) // remote errors are always fatal
125+ }
126+ ChannelMetrics .ChannelErrors .withTags(tags).increment()
119127 }
120128
121129 case e : ChannelStateChanged =>
0 commit comments