temporalio / temporalio/temporal
Metric on workflows not progressing because of repetitive Workflow Task Timeouts / Failures
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Is your feature request related to a problem? Please describe.
One specific Temporal workflow may be completely stuck because something causes Workflow Tasks to repetitively fail or timeout.
SDKs don't report Workflow Task Timeout and generally do their best to avoid them. Hence, when Workflow Task Timeout happens, something went wrong on the SDK side and SDK shouldn't be trusted in this situation. Temporal Server enforces the timeout and should be responsible for producing the metric.
Describe the solution you'd like
Temporal Server already has LOGGING about some workflows reaching a threshold of workflow task timeouts in a row:
https://github.com/temporalio/temporal/blob/61b9b65744e455d4a85681b117e8315287911621/service/history/workflow/workflow_task_state_machine.go#L763
This should be exposed as a metric reporting a number of workflows that have more than N failed workflow tasks in a row to simplify detection of this situation by the users.
This may also be exposed as a histogram where x is an amount of failed workflow tasks in a row and y is number of workflows to don't bring some artificial static system-wide limit that has to be reached before the metric is reported.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in service/history/workflow/workflow_task_state_machine.go at the referenced line, where repetitive workflow task timeouts are logged. Trace the existing threshold and metric patterns in the surrounding workflow state-machine code, then clarify whether the result should be a count or histogram. Done means the server exposes the agreed metric for workflows with consecutive failures or timeouts and its behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100