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) <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-03-31 12:11:13 +01:00
parent befffc573c
commit 8f2507a945

View File

@@ -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<int64_t>(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<std::uint64_t> requestId{0};
auto& perfLog = context.app.getPerfLog();