Skip to content

Show update handler and ID in logging context #466

@drewhoskins-temporal

Description

@drewhoskins-temporal

Is your feature request related to a problem? Please describe.

It's hard to tell when log lines occurred within an update (or signal, or query) handler.

Describe the solution you'd like

I logged from within an update handler in the python SDK with self.logger.info
Imagining I saw this line in production, and I didn’t build the workflow, I could be confused as to why this code is getting executed. In fact, my update handler can also be called by the workflow itself, meaning it'd be nice if the context clarified whether I'm in an update handler or the main workflow.

Or I might want to grep the logs for all the times when an update/signal/query was called.

INFO:batch_orchestrator:This is my log message. ({'attempt': 1, 'namespace': 'default', 'run_id': '183ba64c-a415-492a-b569-a0e97d1a3114', 'task_queue': 'my-task-queue', 'workflow_id': 'inflate_product_prices-37acbbae-d941-4be8-8242-56f15a91d892', 'workflow_type': 'BatchOrchestrator'})

I'd love if the context or prefix listed which handler it's in somehow and perhaps whether it was a signal/update/query. In the case of an update, I'd like to see the update ID.

Additional context

Per-SDK Tickets

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions