add open-task diagnostics to orchestration execution logging#1361
Open
solankisamir wants to merge 2 commits into
Open
add open-task diagnostics to orchestration execution logging#1361solankisamir wants to merge 2 commits into
solankisamir wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds richer diagnostics to orchestration execution logging by capturing how many tasks an orchestration is currently waiting on and a short summary of those tasks.
Changes:
- Populate
OrchestratorExecutionResultandOrchestrationExecutionCursorwith open-task count and a task summary. - Extend structured logging (
OrchestrationExecuted) to include open-task diagnostics in both event source and log message. - Update dispatcher flow to pass these diagnostics through to logging.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/DurableTask.Core/TaskOrchestrationExecutor.cs | Captures open-task diagnostics into the execution result. |
| src/DurableTask.Core/TaskOrchestrationDispatcher.cs | Threads open-task diagnostics from execution result/cursor into logging calls. |
| src/DurableTask.Core/TaskOrchestrationContext.cs | Adds APIs to compute open-task count and a summary string. |
| src/DurableTask.Core/OrchestratorExecutionResult.cs | Adds non-serialized diagnostic fields for open tasks. |
| src/DurableTask.Core/OrchestrationExecutionCursor.cs | Stores open-task diagnostics on the cursor. |
| src/DurableTask.Core/Logging/StructuredEventSource.cs | Extends event signature/payload to include open-task diagnostics. |
| src/DurableTask.Core/Logging/LogHelper.cs | Extends helper API to pass open-task diagnostics into structured log event. |
| src/DurableTask.Core/Logging/LogEvents.cs | Persists new structured fields and includes them in the human-readable message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
This change improves diagnostics for orchestrations that appear stuck (for example, when no new durable actions are scheduled but the orchestration is still waiting on pending work). We had this problem in our Test environment, where an orchestration reached a point and then there were no logs from the application. It looks like the orchestration was hung.
What changed
Added open-task diagnostics to orchestration execution flow:
OpenTaskCountOpenTaskNames(e.g.,ActivityName#12,Timer#8)Captured and propagated this data through execution objects:
TaskOrchestrationContextOrchestratorExecutionResult(internal +[JsonIgnore])OrchestrationExecutionCursorTaskOrchestrationExecutorTaskOrchestrationDispatcherExtended structured logging for
OrchestrationExecuted:LogEvents.OrchestrationExecutednow includes open-task fieldsLogHelper.OrchestrationExecutednow passes open-task fieldsStructuredEventSource.OrchestrationExecutedsignature updated accordinglyWhy
When an orchestration has
0new decisions but still has open tasks, troubleshooting is difficult because logs only show action count. Including open-task count and names provides immediate visibility into what the orchestration is currently waiting on.Scope
Diagnostics/logging only. No orchestration behavior changes.