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-04-20 15:02:35 +01:00
parent a9ee819ea1
commit 21b58a8885

View File

@@ -170,6 +170,8 @@ callMethod(JsonContext& context, Method method, std::string const& name, Object&
rpc_span::attr::role,
context.role == Role::ADMIN ? std::string_view(rpc_span::val::admin)
: std::string_view(rpc_span::val::user));
span.setAttribute("xrpl.node.amendment_blocked", context.app.getOPs().isAmendmentBlocked());
span.setAttribute("xrpl.node.server_state", context.app.getOPs().strOperatingMode().c_str());
static std::atomic<std::uint64_t> requestId{0};
auto& perfLog = context.app.getPerfLog();