sdk-java icon indicating copy to clipboard operation
sdk-java copied to clipboard

workflow_completed counter counts successful completions of workflow method instead of workflow executions

Open Spikhalskiy opened this issue 2 years ago • 1 comments

Expected Behavior

workflow_completed metric counter is expected to count newly completed executions.

Actual Behavior

workflow_completed counter counts successful completion of workflow methods, including replays for example.

Additional Context

The same problem is present for workflow_continue_as_new counter and workflow_failed.

Proposed solution

A worker should log these metrics only after reporting the completion of the workflow task to the server and getting a confirmation from the server that the completion was not rejected.

Spikhalskiy avatar Jan 08 '23 06:01 Spikhalskiy