Log WorkflowID, RunID, domainName when a workflow times out or gets terminated #4548
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.
What changed?
A logging call was added that's going to log a message whenever a workflow is timed out or gets forcefully terminated (but not when it's cancelled or if it finishes in any other way, including normal completion or failure).
Why?
Currently only a metric is logged. Metrics can be used to alert on this condition, but it doesn't make it apparent which workflows are affected. If manual cleanup activities need to be performed (e.g. investigating why the workflow timed out) the operator needs the WorkflowID and/or the RunID. Similar considerations apply for terminations. Although terminations are usually operator-initiated, so it could be expected that the operators already know which workflows are being terminated, I think it's useful to have these in the logs.
How did you test it?
I tested the change by building and running the Cadence server locally. The started a workflow with a 1 second timeout with no workers registered:
This generated the below message:
Potential risks
If, for some reason, workflows time out or get terminated a lot, the high log volume could have adverse effects.
Release notes
N/A
Documentation Changes
N/A