Fix pay metrics status aggregation
This commit is contained in:
@@ -129,7 +129,7 @@ async def _business_metrics() -> list[str]:
|
||||
lines.append(_sample(f"{metric_prefix}_created_total", created, {"service": SERVICE_NAME, "window": window_name}))
|
||||
|
||||
paid_total = await _count(select(func.count()).select_from(Payment).where(Payment.paid_at.is_not(None)))
|
||||
failed_total = await _count(select(func.count()).select_from(Payment).where(Payment.status.in_(["failed", "cancelled", "expired"])))
|
||||
failed_total = await _count(select(func.count()).select_from(Payment).where(Payment.status.in_(["web3_hash_error", "web3_balance_problem", "receipt_error"])))
|
||||
lines.append(_sample("payments_succeeded_total", paid_total, {"service": SERVICE_NAME}))
|
||||
lines.append(_sample("payments_failed_total", failed_total, {"service": SERVICE_NAME}))
|
||||
return lines
|
||||
|
||||
Reference in New Issue
Block a user