expose otel trace context from snapshots

Merged
DA
3mo ago
+926-26

Summary by cubic

Adds traceContext() (JS) / trace_context() (Python) to all snapshot types so manual handlers can nest host tracing under the suspension's span when Monty instrumentation is enabled.

  • Returns the OTel Context captured at feedStart / feed_start (or loadSnapshot / load_snapshot when restoring), with the suspension's span set when Monty tracing is active; composition failures fall back to the captured context, with JS reporting the failure via diag.warn.
  • Without Monty tracing, returns the captured context unchanged.
  • Context is never serialized; restoring snapshots captures the restoring caller's context.
  • Calling after resume throws; contexts obtained earlier remain usable but don't keep the span open.
  • Python requires opentelemetry-api; calling without it raises ImportError.
  • resumeAuto() / resume_auto() already activate the suspension span around callbacks.