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

Add ability to not log errors from activities

Open mfateev opened this issue 4 years ago • 7 comments

From Slack:

In the worker side, how would you skip logging activity errors (returned as *cadence.CustomError) that are subsequently handled gracefully (ContinueAsNewError) by the calling workflow? Possibly skip only partially. I couldn't find support for accessing error details + rescinding entry from zap hooks.

One idea is to move all such logging into interceptors and allow redefining them.

mfateev avatar Mar 26 '20 15:03 mfateev

Another request is to be able to specify logging behavior per specific error. For example we recommend failing an activity constantly to implement polling. And in this case the error should not be logged. My strawman proposal is to add "doNotLog" flag to the ApplicationError.

mfateev avatar Jul 31 '20 16:07 mfateev

@mfateev How is this issue status? I also have a case where I need to suppress error logging for a polling activity.

Is there a way to work around this while this issue is not resolved?

Thank you!

fernando-cicconeto avatar Jul 24 '23 13:07 fernando-cicconeto

I also have a case where I need to suppress error logging for a polling activity. Any status update on this?

inspell avatar Feb 19 '24 08:02 inspell

I also need that feature, any updates?

seanmoghadam avatar Mar 25 '24 08:03 seanmoghadam

While this feature does not exist yet, you can customize your logger interface implementation to ignore "Activity error." messages. There are even tags on the log statement for which activity and error it is if you need to be specific.

cretz avatar Mar 25 '24 13:03 cretz

Also need to suppress the metrics temporal_activity_execution_failed.

yiminc avatar Apr 17 '24 19:04 yiminc