Skip to content

fix: use failure details for failed orchestration span messages#290

Open
YunchuWang wants to merge 1 commit into
mainfrom
copilot-finds/bug/fix-failed-orch-span-error-message
Open

fix: use failure details for failed orchestration span messages#290
YunchuWang wants to merge 1 commit into
mainfrom
copilot-finds/bug/fix-failed-orch-span-error-message

Conversation

@YunchuWang

Copy link
Copy Markdown
Member

Summary

Fixes #218

…tions

setOrchestrationStatusFromActions() was reading the error message from
completeAction.getResult(), but failed orchestrations store the error in
failureDetails (not result). This caused all failed orchestration spans to
show the generic 'Orchestration failed' message instead of the actual error.

Now reads from failureDetails.getErrormessage() first, with fallback to
result for backwards compatibility.

Fixes #218

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 7, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves OpenTelemetry span diagnostics for failed orchestrations by sourcing the span status message from failureDetails (the field populated by the runtime) instead of the result field, aligning tracing output with actual failure data and addressing issue #218.

Changes:

  • Update setOrchestrationStatusFromActions() to read failed-orchestration error messages from failureDetails, with a fallback to result for backward compatibility.
  • Adjust and extend tracing tests to cover failureDetails, legacy result fallback, and the default-message fallback.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/durabletask-js/src/tracing/trace-helper.ts Reads orchestration failure span message from failureDetails (with fallback chain).
packages/durabletask-js/test/tracing.spec.ts Updates existing failure test and adds coverage for result/default fallback behavior.

Comment on lines +697 to +700
const errorMessage =
completeAction.getFailuredetails()?.getErrormessage() ||
completeAction.getResult()?.getValue() ||
"Orchestration failed";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants