brendan
05/02/2024, 5:25 PMfrom prefect.logging import get_run_logger
To output logs in our flows/runs. This allows us to include the context (flow/task run names) in DataDog and improves visibility into these prefect jobs overall. If we catch an error and log it using the above mentioned function at the proper severity, then the context information is available to us in the log as expected.
However, there are situations where some unforeseen (uncaught) error causes a flow run to fail. In those situations no context about the flow or task is included in the logs. And visibility suffers. (See attached images for both situations)
My question is, is there a way to include context information about a flow by default for all logs? Even unforeseen errors that have not been caught in a try/except and passed to get_run_logger
or get_flow_logger
?