Skip to content

Commit

Permalink
Add metric to count number of calls to accept_invoice with not enough…
Browse files Browse the repository at this point in the history
… funds (#1700)
  • Loading branch information
nieznanysprawiciel authored Nov 22, 2021
1 parent d3a2189 commit a7290f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/payment/src/api/invoices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ async fn accept_invoice(
"Not enough funds. Allocated: {} Needed: {}",
allocation.remaining_amount, amount_to_pay
);

counter!("payment.invoices.requestor.not-enough-funds", 1);
return response::bad_request(&msg);
}

Expand Down
1 change: 1 addition & 0 deletions core/payment/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ mod local {
counter!("payment.invoices.provider.paid", 0);
counter!("payment.invoices.provider.accepted", 0);
counter!("payment.invoices.provider.accepted.call", 0);
counter!("payment.invoices.requestor.not-enough-funds", 0);

counter!("payment.amount.received", 0, "platform" => "erc20-rinkeby-tglm");
counter!("payment.amount.received", 0, "platform" => "erc20-mainnet-glm");
Expand Down

0 comments on commit a7290f4

Please sign in to comment.