Skip to content

fix: OTel operation spans report DurableOperationException instead of the original error type - #860

Merged
zhongkechen merged 3 commits into
mainfrom
implement-issue-847
Nov 2, 2026
Merged

zhongkechen merged 3 commits into
mainfrom
implement-issue-847

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #847

Summary

Failed durable-operation exception events now use a nonblank stored ErrorObject.errorType in both Invocation and Execution trace views. This preserves remote-language types such as RejectedError instead of reporting the SDK's DurableOperationException wrapper. Missing, empty, or whitespace-only types retain the existing throwable-type fallback.

Both event paths previously derived the type from the wrapper instead of its stored error. The shared helper supplies only the type override to native recordException and the existing timestamped event builder. A stored type must be nonblank to replace the fallback. Blank values still count as supplied error details, so the exception event remains present. Nonblank values are used verbatim, and checkpoint payloads are not normalized.

Message/stack diagnostics, timestamps, attempt events, caller-visible exceptions, and Workflow/Invocation reporting remain unchanged. Replacing the throwable would change its diagnostic details, so the change reuses the existing event paths.

Regression coverage and corrected expectations

  • OperationExceptionEventTest.storedTypeChangesOnlyTheOperationExceptionType covers missing/null/empty/whitespace types, remote types, and current-clock/epoch/backend timestamps. It compares complete attribute maps because native OpenTelemetry events and AttributesBuilder.build() use different container implementations. The earlier empty-type expectation was incorrect: supplied error details do not imply a usable exception type. Empty, ASCII whitespace, and Unicode whitespace now assert the throwable fallback; nonblank padded values remain verbatim.
  • CallbackErrorMetadataTest checks type-only empty and whitespace callback errors through both trace views, retaining the event and the original checkpoint/caller payload. Replay still skips completed user code.
  • OperationExceptionTypeIntegrationTest exercises child contexts, conditions, callbacks, and invokes. Replay requires exactly the documented DurableExecutionRoot, Invocation, and Workflow spans, rejecting repeated operation/attempt spans.
  • Existing backend-timing coverage checks stored exception types without changing timestamps. README documents the nonblank-type selection rule.

Validation

  • New blank-type regressions before the guard: 12 event-timestamp cases and 4 callback cases failed. All 76 focused event, callback, replay, and timing cases pass with the guard.
  • Java 17 mvn -o -B -ntp -pl otel-plugin -am clean verify spotless:check: passed; 2,630 tests, 0 failures/errors, 5 configured skips. All 979 OTel plugin tests passed.
  • GitHub CI on 58927ff2: Java 17/21/25 builds, Spotless, all CodeQL analyses, and all four OTel cloud conformance jobs passed. The automated review of this commit reported no actionable findings.

Correct OTel operation exception types using stored errors in both trace views, preserving fallback and boundary reporting, with regression coverage.

Codex-Automation: issue-implementation
Codex-Issue: #847
Codex-Issue-Snapshot: a2e7dfa554acd069f7ad54c6350a2d20d53657d1ecfd96b1b92426aa12a596c0
Codex-Implementation-Command: 2d8c6dce52857c042e6fdd5b04b7a12628557051ef0b161efcb787e4b78b308a
Codex-Publication-Metadata: eyJjaGFuZ2VkX3BhdGhfY291bnQiOjQsImNoYW5nZWRfcGF0aHMiOlsib3RlbC1wbHVnaW4vc3JjL21haW4vamF2YS9zb2Z0d2FyZS9hbWF6b24vbGFtYmRhL2R1cmFibGUvb3RlbC9PdGVsUGx1Z2luU3VwcG9ydC5qYXZhIiwib3RlbC1wbHVnaW4vc3JjL3Rlc3QvamF2YS9zb2Z0d2FyZS9hbWF6b24vbGFtYmRhL2R1cmFibGUvb3RlbC9CYWNrZW5kT3BlcmF0aW9uVGltaW5nVGVzdC5qYXZhIiwib3RlbC1wbHVnaW4vc3JjL3Rlc3QvamF2YS9zb2Z0d2FyZS9hbWF6b24vbGFtYmRhL2R1cmFibGUvb3RlbC9PcGVyYXRpb25FeGNlcHRpb25FdmVudFRlc3QuamF2YSIsIm90ZWwtcGx1Z2luL3NyYy90ZXN0L2phdmEvc29mdHdhcmUvYW1hem9uL2xhbWJkYS9kdXJhYmxlL290ZWwvT3BlcmF0aW9uRXhjZXB0aW9uVHlwZUludGVncmF0aW9uVGVzdC5qYXZhIl0sImltcGxlbWVudGF0aW9uX2NvbW1hbmQiOnsiZGlnZXN0IjoiMmQ4YzZkY2U1Mjg1N2MwNDJlNmZkZDViMDRiN2ExMjYyODU1NzA1MWVmMGIxNjFlZmNiNzg3ZTRiNzhiMzA4YSIsImd1aWRhbmNlIjoiIn0sInJlc3VsdCI6eyJvdXRjb21lIjoiY2hhbmdlZCIsInN1bW1hcnkiOiJDb3JyZWN0IE9UZWwgb3BlcmF0aW9uIGV4Y2VwdGlvbiB0eXBlcyB1c2luZyBzdG9yZWQgZXJyb3JzIGluIGJvdGggdHJhY2Ugdmlld3MsIHByZXNlcnZpbmcgZmFsbGJhY2sgYW5kIGJvdW5kYXJ5IHJlcG9ydGluZywgd2l0aCByZWdyZXNzaW9uIGNvdmVyYWdlLiIsInZhbGlkYXRpb24iOlsiSmF2YSAxNyBzeW50YXggcGFyc2luZyBwYXNzZWQgZm9yIGFsbCBmb3VyIGNoYW5nZWQgZmlsZXM7IHR5cGUgY2hlY2tpbmcgd2FzIG5vdCBwZXJmb3JtZWQuIiwiZ2l0IGRpZmYgLS1jaGVjayBhbmQgd2hpdGVzcGFjZSBjaGVja3MgcGFzc2VkLiIsIk9mZmxpbmUgTWF2ZW4gcmVncmVzc2lvbiB0ZXN0cyB3ZXJlIGJsb2NrZWQgYnkgdW5jYWNoZWQgQVdTIFNESyBhbmQgSmFja3NvbiBCT01zLiIsIm12biBzcG90bGVzczphcHBseSB3YXMgYXR0ZW1wdGVkIG9mZmxpbmUgYnV0IGJsb2NrZWQgYnkgdGhlIHNhbWUgbWlzc2luZyBkZXBlbmRlbmNpZXMuIl19LCJ2ZXJzaW9uIjoyfQ
@zhongkechen zhongkechen changed the title Implement #847: [Bug]: OTel operation spans report DurableOperationException instead of the original error type fix: OTel operation spans report DurableOperationException instead of the original error type Nov 2, 2026
@zhongkechen
zhongkechen marked this pull request as ready for review November 2, 2026 20:33
@zhongkechen
zhongkechen requested a review from a team November 2, 2026 20:33
@zhongkechen
zhongkechen deployed to ai-pr-review-runtime November 2, 2026 20:33 — with GitHub Actions Active
@zhongkechen
zhongkechen deployed to ai-pr-review-runtime November 2, 2026 20:36 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@zhongkechen
zhongkechen deployed to ai-pr-review-runtime November 2, 2026 20:44 — with GitHub Actions Active
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Codex AI review

No actionable findings in the full diff against the SDK invariants and applicable contribution rules. Tests were not executed during this read-only review, so reported test results remain independently unverified.

Reviewed commit 58927ff27e9032fc0f31a3d1260b87831d93ac1f. Workflow run

@zhongkechen
zhongkechen merged commit 9e55539 into main Nov 2, 2026
25 checks passed
@zhongkechen
zhongkechen deleted the implement-issue-847 branch November 2, 2026 21:25

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — 58927ff2 Deployed Nov 2, 2026 by zhongkechen via ai-pr-review / Codex review / Generate Codex review #2783
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OTel operation spans report DurableOperationException instead of the original error type

2 participants