datarobot_genai.core.telemetry.nat_context
nat_context
Bridge NAT workflow trace context into the OpenTelemetry SDK context.
push_nat_span_context
Record the active NAT span as the SDK parent for a workflow run.
Source code in datarobot_genai/core/telemetry/nat_context.py
pop_nat_span_context
Remove one NAT span level for a workflow run.
Source code in datarobot_genai/core/telemetry/nat_context.py
reset_nat_span_context
Clear NAT span levels for one workflow run (or the local fallback stack).
Source code in datarobot_genai/core/telemetry/nat_context.py
use_nat_workflow_trace_context
Ensure SDK spans join the active NAT workflow trace when possible.
When datarobot_otelcollector is active it keeps a per-run NAT span stack
aligned with intermediate steps. This helper attaches that parent (or falls
back to workflow_trace_id) only for the duration of the caller's scope.