You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
but the problem with them is that I have to register them at worker initialization and don't know the values at that point
You don't need to know the values at that point, both activity and workflow outbound interceptors have GetLogger you can customize when called. https://github.com/temporalio/samples-go/tree/main/interceptor shows how to write the interceptor, but you can use the workflow/activity context in the interceptor to get workflow/activity-specific things like memo (or values via context propagation which may make more sense).
You don't need to know the values at that point, both activity and workflow outbound interceptors have `GetLogger` you can customize when called. https://github.com/temporalio/samples-go/tree/main/interceptor shows how to write the interceptor, but you can use the workflow/activity context in the interceptor to get workflow/activity-specific things like memo (or values via context propagation which may make more sense).
Are context values being persisted across activity / workflow retries
and such?
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
andActivityOptions
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.
The text was updated successfully, but these errors were encountered: