Skip to content

Log workflow task duration with external storage metrics - #3140

Merged
jmaeagle99 merged 8 commits into
mainfrom
storage-duration
Oct 15, 2026
Merged

jmaeagle99 merged 8 commits into
mainfrom
storage-duration

Conversation

@jmaeagle99

Copy link
Copy Markdown
Contributor

What was changed

When a WFT takes longer than 5 seconds, emit a TMPRL1104 warn log with external storage data. Threshold can be configured via the TEMPORAL_WORKFLOW_TASK_DURATION_WARN_SECONDS environment variable.

Why?

Help customers better identify causes of long running workflow tasks.

Checklist

  1. Closes SDK should log when WFT completion takes a long time - Java #2883

  2. How was this tested: unit tests

  3. Any docs updates needed? No

@jmaeagle99
jmaeagle99 requested a review from a team as a code owner October 9, 2026 18:09
@cconstable

Copy link
Copy Markdown
Contributor

WorkflowWorker also handles task failures and query responses but I don't think those are covered by this PR. Should those also update the PayloadUploadCount?

@cconstable

Copy link
Copy Markdown
Contributor

Claude found a few things that seemed reasonable:

  • The timer also covers the RespondWorkflowTaskCompleted call to the server. The existing WORKFLOW_TASK_EXECUTION_LATENCY metric does not. That may be intended, but it means the two numbers won't match. Worth a sentence in the doc comment.
  • Setting the variable to 0 warns on every task, and there is no way to turn the warning off. Is that intended?

@jmaeagle99
jmaeagle99 requested a review from cconstable October 15, 2026 03:16
@jmaeagle99
jmaeagle99 enabled auto-merge (squash) October 15, 2026 19:17
@jmaeagle99
jmaeagle99 merged commit 63a34cc into main Oct 15, 2026
34 of 35 checks passed
@jmaeagle99
jmaeagle99 deleted the storage-duration branch October 15, 2026 23:35
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.

SDK should log when WFT completion takes a long time - Java

2 participants