From beb5b2dddc1429669f9bfe91e13ecaf5cc2105dc Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Wed, 22 Jul 2026 13:11:53 +0100 Subject: [PATCH] fix(telemetry): scope ledger.build so tx.apply nests under it ledger.build was left as unscoped SpanGuard after the type split, so tx.apply (created synchronously during applyTxs on the same JtAccept worker) no longer nested under it. buildLedgerImpl runs synchronously with no yield, so ScopedSpanGuard is safe and restores the ledger.build -> tx.apply edge. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/xrpld/app/ledger/detail/BuildLedger.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xrpld/app/ledger/detail/BuildLedger.cpp b/src/xrpld/app/ledger/detail/BuildLedger.cpp index d0e8967c09..482721bf6a 100644 --- a/src/xrpld/app/ledger/detail/BuildLedger.cpp +++ b/src/xrpld/app/ledger/detail/BuildLedger.cpp @@ -50,7 +50,9 @@ buildLedgerImpl( ApplyTxs&& applyTxs) { using namespace telemetry; - auto buildSpan = SpanGuard::span(TraceCategory::Ledger, seg::ledger, ledger_span::op::build); + // Scoped so tx.apply (created synchronously below during applyTxs on this + // thread) nests under it. buildLedgerImpl runs synchronously with no yield. + auto buildSpan = ScopedSpanGuard(TraceCategory::Ledger, seg::ledger, ledger_span::op::build); auto built = std::make_shared(*parent, closeTime);