Skip to content

Commit

Permalink
Add simple multi-part Kamon metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bast committed Oct 1, 2019
1 parent 6c75c19 commit dc50621
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions eclair-core/src/main/scala/fr/acinq/eclair/payment/Auditor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,37 @@ class Auditor(nodeParams: NodeParams) extends Actor with ActorLogging {
Kamon
.histogram("payment.hist")
.withTag("direction", "sent")
.withTag("type", "amount")
.record(e.amount.truncateToSatoshi.toLong)
Kamon
.histogram("payment.hist")
.withTag("direction", "sent")
.withTag("type", "fee")
.record(e.feesPaid.truncateToSatoshi.toLong)
Kamon
.histogram("payment.hist")
.withTag("direction", "sent")
.withTag("type", "parts")
.record(e.parts.length)
db.add(e)

case _: PaymentFailed =>
Kamon
.counter("payment.failures.count")
.withTag("direction", "sent")
.increment()

case e: PaymentReceived =>
Kamon
.histogram("payment.hist")
.withTag("direction", "received")
.withTag("type", "amount")
.record(e.amount.truncateToSatoshi.toLong)
Kamon
.histogram("payment.hist")
.withTag("direction", "received")
.withTag("type", "parts")
.record(e.parts.length)
db.add(e)

case e: PaymentRelayed =>
Expand Down

0 comments on commit dc50621

Please sign in to comment.