docs(telemetry): DeterministicIdGenerator is active via hashSpan, not dormant

The generator's doc said it was 'dormant, caller lands on a later branch'.
Reworded to branch-agnostic language: hashSpan() is the primary caller that
forces the root branch to mint deterministic trace roots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-07-21 20:39:29 +01:00
parent 4d95f455f4
commit f6f0e72224

View File

@@ -55,11 +55,12 @@ namespace xrpl::telemetry {
* @note Limitation: minting a deterministic root only works when the caller
* forces the SDK's root branch (e.g. by starting the span with a
* Context{kIsRootSpanKey, true}); otherwise the SDK reuses the parent's
* trace_id and never calls GenerateTraceId(). That caller (hashSpan) lands on
* a later branch, so this generator is installed but dormant here.
* trace_id and never calls GenerateTraceId(). The primary such caller is
* SpanGuard::hashSpan(), which forces the root branch to mint deterministic
* per-object trace roots.
*
* Example 1 - primary use, inside a forced-root hash span (arrives on a later
* branch; shown as pseudocode):
* Example 1 - primary use, inside a forced-root hash span (shown as
* pseudocode):
* @code
* // std::array<std::uint8_t, 16> id = deriveTraceIdFromHash(txHash);
* // PendingTraceId const pending{id}; // pin id for this thread
@@ -128,8 +129,7 @@ public:
* guards on one thread is unsupported: the inner guard consumes/clears first,
* so the outer id is silently dropped and its destructor trips the assert.
*
* Example 1 - primary use, wrapping a forced-root span start (pseudocode; the
* caller lands on a later branch):
* Example 1 - primary use, wrapping a forced-root span start (pseudocode):
* @code
* // {
* // PendingTraceId const pending{id}; // pin for this scope