Repository navigation
fix: correct terminal telemetry status and timing - #865
Open
zhongkechen wants to merge 4 commits into
Open
zhongkechen wants to merge 4 commits into
zhongkechen wants to merge 4 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
Codex AI reviewNo actionable findings after reviewing all six changed files against CONTRIBUTING.md rules 1–9. Tests were inspected but not executed. Deployed Lambda/exporter behavior remains unverified. Reviewed commit |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available
Fixes #853.
Description of changes
Operations ending FAILED, TIMED_OUT, or STOPPED without diagnostic details now
produce ERROR spans in both OTel views. Supplied operation and attempt exceptions
are recorded at the same normalized timestamp used to end their span, so delayed
completion delivery cannot put the event after the span. A failed attempt without
diagnostics does not fabricate an exception event.
CANCELLED without an error remains UNSET, RETRY remains RETRYING/UNSET, and a caught
operation failure does not make a successful Invocation or Workflow span fail.
Existing exception type/message/stack preservation is retained. The README
documents the refined status mapping and timing behavior.
Design
are unchanged. The issue specifies the refined telemetry outcome contract.
normalization and the existing exception recorder. Replacing the timestamp
normalization or adding another terminal-delivery path would duplicate logic.
Merely changing status would leave exception events outside delayed spans.
recording independently chose the current clock while span completion used
durable or invocation-normalized time. The exception helper also synthesized
diagnostics for errorless failed attempts.
members or configuration options.
Validation
120 passed in the focused status/timing and public-handler suite. Failures
demonstrate missing ERROR status, fabricated events for errorless attempts,
and exception events differing from or falling after their span end.
hatch run dev-otel:test -q --tb=short: 865 passed.hatch run dev-otel:typecheck: no issues in 45 source files.hatch fmt --check: passed.hatch build: passed.hatch run test-wheel-otel:test: 865 OTel tests and 12 lifecycle testspassed, after verifying built core/OTel source bytes and artifact hashes.
The public-handler tests cover caught checkpointed child, virtual child, and
chained-invoke failures, with and without a durable wait/replay. They assert
successful Invocation/Workflow status, bounded events, saved step execution
exactly once, and reuse of stored nonvirtual failure outcomes.
Existing expectation change:
test_operation_status_and_exceptionnow expectsERROR, rather than UNSET, for FAILED/TIMED_OUT/STOPPED without an error. It still
requires no exception event and preserves the original durable status attribute.
The matrix is expanded to include STARTED/PENDING/READY controls. Other added
tests do not replace existing behavioral expectations.
CI follow-up
All four ADOT/X-Ray and Community/S3 jobs
each reported 19 passing cases, case 11 failing, and seven uncovered requirements.
The exact same case-11 history mismatch and counts occur on
main at d7ae955.
The handler/coverage repair remains #864/#796; this PR does not claim case-25
cloud qualification.
The cloud-example workflow
failed in Python 3.11/3.13 because
GetDurableExecutionHistorywas throttled afterfour retries. The affected handlers have no OTel plugin and their polling code is
unchanged. Python 3.12/3.14 passed. No #853-caused regression was found in these
failures.
Combined local validation of all six scoped fixes passed 5,058 core/OTel/testing
tests. Merge coordination for the shared terminal renderers is recorded in #869.
Assumptions
ERROR while the caught workflow succeeds; see the
shared execution requirement.
SimpleSpanProcessor, and InMemorySpanExporter in both views.
remains in test(otel): cover replay and chained execution #796. No conformance requirement or handler is changed.
Decisions not covered by the issue or the design note
_end_spanso events andspan completion share one invocation-ordering tick.
only absence of the error object suppresses the event. Empty callback error
normalization remains in [Testing]: Preserve empty callback error history without changing runtime errors #862.
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and
redistribute this contribution, under the terms of your choice.