From 8f2507a9457d59984bc6eff8d318ba7f235505e5 Mon Sep 17 00:00:00 2001 From: Pratik Mankawde <3397372+pratikmankawde@users.noreply.github.com> Date: Tue, 31 Mar 2026 12:11:13 +0100 Subject: [PATCH] feat(telemetry): add node health attributes to RPC spans (Task 2.8) Add amendment_blocked and server_state span attributes to every rpc.command.* span so operators can correlate RPC behavior with node state. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/xrpld/rpc/detail/RPCHandler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xrpld/rpc/detail/RPCHandler.cpp b/src/xrpld/rpc/detail/RPCHandler.cpp index 802f041813..01ea162e44 100644 --- a/src/xrpld/rpc/detail/RPCHandler.cpp +++ b/src/xrpld/rpc/detail/RPCHandler.cpp @@ -162,6 +162,8 @@ callMethod(JsonContext& context, Method method, std::string const& name, Object& XRPL_TRACE_SET_ATTR("xrpl.rpc.command", name.c_str()); XRPL_TRACE_SET_ATTR("xrpl.rpc.version", static_cast(context.apiVersion)); XRPL_TRACE_SET_ATTR("xrpl.rpc.role", (context.role == Role::ADMIN ? "admin" : "user")); + XRPL_TRACE_SET_ATTR("xrpl.node.amendment_blocked", context.app.getOPs().isAmendmentBlocked()); + XRPL_TRACE_SET_ATTR("xrpl.node.server_state", context.app.getOPs().strOperatingMode().c_str()); static std::atomic requestId{0}; auto& perfLog = context.app.getPerfLog();