temporalio / sdk-java

Temporal Java SDK
https://temporal.io
Apache License 2.0
220 stars 147 forks source link

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

Open Spikhalskiy opened 1 year ago

Spikhalskiy commented 1 year ago

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.

cretz commented 1 year ago

I think we need to fix this in multiple SDKs. May be worth an sdk-features issue.