-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include update info in logging output #664
Conversation
f4ed4c0
to
f94249e
Compare
temporalio/workflow.py
Outdated
@@ -500,6 +500,14 @@ class UpdateInfo: | |||
name: str | |||
"""Update type name.""" | |||
|
|||
@property | |||
def logger_details(self) -> Mapping[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def logger_details(self) -> Mapping[str, Any]: | |
def _logger_details(self) -> Mapping[str, Any]: |
I don't think we should make this public (and have it then be stable API)
temporalio/workflow.py
Outdated
update_info = current_update_info() | ||
if update_info: | ||
if self.update_info_on_extra: | ||
extra["temporal_update"] = asdict(update_info) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arguably update info is just more workflow info and doesn't need a separate top-level key. I think it can just have the extra fields be put into temporal_workflow
section same as appending to the message does.
temporalio/workflow.py
Outdated
@@ -1220,6 +1236,7 @@ def __init__( | |||
super().__init__(logger, extra or {}) | |||
self.workflow_info_on_message = True | |||
self.workflow_info_on_extra = True | |||
self.update_info_on_extra = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this deserves a separate setting. I think these two pieces of update information can be considered workflow information (and we are considering them workflow information for purposes of appending to the message, might as well in the extra too consistently).
173468b
to
09fcea6
Compare
747db44
to
361df16
Compare
Closes #648: include update info in logging output when in the context of an update execution
Also changes behavior such that if user logging call uses one of our keys then their call has precedence; this is the behavior of
merge_extra=True
added in Python 3.13.How this was tested