Description
Is your feature request related to a problem? Please describe.
I want to be able to easily attach business-related log fields to the log messages the SDK logs internally for workflows and activities.
One of such logs is
sdk-go/internal/internal_task_handlers.go
Line 2271 in 6e75f6d
The business-related values I want to attach are only known during workflow and activity creation and NOT during worker initialization.
Describe the solution you'd like
Configuring them via StartWorkflowOptions
and ActivityOptions
seems desirable.
Describe alternatives you've considered
I've looked into using Interceptors, but the problem with them is that I have to register them at worker initialization and don't know the values at that point. I've looked into using custom search attributes or memos - which both would work but only exist of Workflows and not Activities. I also haven't found a way to easily retrieve the search attributes / memos of the workflow given an activity context.
The elaborate on the search attributes / memos approach: I basically would register an interceptor that reads the search attributes / memos from the workflow context and create a new logger with them that is returned.
What I want to avoid is having to query that data from within the activity interceptor from an "external" system.
Additional context
Add any other context or screenshots about the feature request here.