mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-23 15:10:34 +00:00
Add a custom OTel IdGenerator that returns a thread-local pending trace_id on the SDK no-parent (root) branch and a random one otherwise, plus a PendingTraceId RAII guard that pins that id for the next forced-root span and asserts on destruction that it was consumed. Wire the generator into TracerProviderFactory::Create via its 4-arg overload. This lets hash-derived spans become true trace roots so they line up into one trace across nodes. It is installed but dormant on this branch: the caller (hashSpan) arrives on a later branch (phase-3). GenerateSpanId is always random and is_random_ is false so the W3C random-trace-id flag is not set on deterministic ids. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>