From 15374d885910a893aaee68a6aee222653b2f5916 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Thu, 14 May 2026 18:00:46 +0100 Subject: [PATCH] xpay: add traces for payments Produce traces (see common/trace.h) for every payment in order to gather statistics about the duration of a full payment execution. Changelog-None Signed-off-by: Lagrang3 --- plugins/xpay/xpay.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/xpay/xpay.c b/plugins/xpay/xpay.c index 6a0ff3093876..102a7bc604ce 100644 --- a/plugins/xpay/xpay.c +++ b/plugins/xpay/xpay.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -2427,6 +2428,9 @@ static struct payment *new_payment(const tal_t *ctx, { struct xpay *xpay = xpay_of(cmd->plugin); struct payment *payment = tal(ctx, struct payment); + /* Start tracing the payment until it is destroyed. */ + trace_span_start("xpay/payment", payment); + trace_span_suspend_may_free(payment); payment->plugin = cmd->plugin; payment->deadline = timemono_add(time_mono(), time_from_sec(retryfor));