feat(otel): parent durable spans to shared trace - #693
Conversation
|
/ai review |
2be288e to
aec6acf
Compare
| ContextExtractor = Callable[["InvocationStartInfo"], ExtractedContext | None] | ||
|
|
||
|
|
||
| def _ensure_extracted_context(extracted: object) -> ExtractedContext | None: | ||
| """Validate a context extractor result.""" | ||
| if extracted is None or isinstance(extracted, ExtractedContext): | ||
| return extracted | ||
| msg = "context extractor must return ExtractedContext or None" | ||
| raise TypeError(msg) |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_jmtbmucp2dm4ijijefd7jx7nco
[P1] Preserve the existing ContextExtractor contract. This public type previously returned an OpenTelemetry Context, so existing custom extractors now raise TypeError on every invocation and produce no telemetry. Support legacy Context results through an adapter/deprecation period (extracting their active SpanContext), or introduce a separate new configuration API, and retain a regression test using lambda _: Context().
| after_resume = next(span for span in spans if span.name == "otel-after-resume") | ||
|
|
||
| assert len(invocations) >= 2 | ||
| assert len(waits) >= 2 |
There was a problem hiding this comment.
Codex AI review · Finding arf_v1_vawkqcby4mibdv6padk3raorfm
[P1] Account for the execution-view plugin's suspended-span behavior. ExecutionOtelPlugin.on_invocation_end deliberately leaves the first invocation's pending wait span unended and unexported, so only the resumed continuation is present and len(waits) is 1. This parametrized test therefore fails for ExecutionOtelPlugin; use plugin-specific minimum counts or change that plugin's lifecycle semantics consistently.
| assert len(waits) >= 2 | |
| minimum_wait_count = 2 if plugin_type is InvocationOtelPlugin else 1 | |
| assert len(waits) >= minimum_wait_count |
Codex AI reviewTwo blocking issues remain: a public context-extractor compatibility break and an E2E assertion that fails for Reviewed commit |
Issue #, if available: #674
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.