Skip to content
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

workflow Logs enhancements - Structured logging and right log levels #626

Closed
rabollin opened this issue Oct 27, 2023 · 6 comments · Fixed by #645
Closed

workflow Logs enhancements - Structured logging and right log levels #626

rabollin opened this issue Oct 27, 2023 · 6 comments · Fixed by #645
Assignees
Labels

Comments

@rabollin
Copy link

rabollin commented Oct 27, 2023

Improve the debuggability of Dapr Workflows by (a) identifying gaps in logging and improving them, and (b) making the error reporting consistent across.

Explore structured logging like TIME LEVEL WORKFLOW_ID SOURCE MESSAGE where SOURCE can be Dapr Client or DTF (can have subcategories which we MAY consider including worker/client/task - mostly not required from Python SDK POV). Also requires setting up logger formatter in DTF Clients for each SDK.

Logs grouping for Starting the DTF worker, successful connection to gRPC server etc.. Currently it shows just this one statement.

== APP - WorkflowConsoleApp == INFO: Durable Task worker is connecting to sidecar at 127.0.0.1:61659.

Workflow Execution: The logs are capturing only very superficial as Workflow started, waiting for activity as shown here (logs from Python SDK). Capture Workflow Name, Workflow ID too in the messages below.

== APP - order-processor == 2023-10-20 18:24:48.276 durabletask-worker INFO: Starting gRPC worker that connects to 127.0.0.1:61723

== APP - order-processor == 2023-10-20 18:24:48.285 durabletask-worker INFO: Successfully connected to 127.0.0.1:61723. Waiting for work items...

== APP - order-processor == start_resp = daprClient.start_workflow(workflow_component=workflow_component,

== APP - order-processor == Starting order workflow, purchasing 10 of cars

Workflow Activity level logging: The logs below show as waiting for tasks and events, but nothing beyond that. Should capture Parent ID (Workflow ID), Task ID, Task name, Task status, event ID, event status as relevant in each log message.

== APP - order-processor == 2023-10-20 18:24:52.332 durabletask-worker INFO: 57044fb1-5f7b-4912-ad6e-f87595cb6ec2: Waiting for 1 task(s) and 0 event(s).

18:24:52.402 durabletask-worker INFO: 57044fb1-5f7b-4912-ad6e-f87595cb6ec2: Waiting for 1 task(s) and 1 event(s).

Categorization of log levels for Workflow logs for ease – Warning, Info & Debug

Debug logs to contain more finer details about activities: Make sure that SDKs support disabling Debug logs to not bombard app logs with too many logs

@rabollin rabollin added the kind/bug Something isn't working label Oct 27, 2023
@shivamkm07
Copy link
Contributor

Following are some of the logging enhancements which should improve Workflow debuggability, w.r.t python-sdk

  1. Following log lines can be added to improve SDK logging:
    Workflow Authoring
    i. Scheduling activity: Scheduling activity {activity_name}
    ii. Creating timer: Creating timer to fire at {deadline}
    iii. Scheduling child workflow: Scheduling child-workflow {child_workflow_name}
    iv. Wait for external event: Waiting for the event {event_name} to be raised
    v. Continue-as-new: Continuing the execution as new instance
    Workflow Runtime:
    i. Register workflow: Registering workflow {workflow_name} with runtime
    ii. Register activity: Registering activity {activity_name} with workflow {workflow_name}
  2. Add support for Logger in DaprClient: Currently there is no logger initialized while starting the Dapr Client. Also there is no support for multiple log levels like INFO, DEBUG etc. Enable support in DaprClient as well as DaprWorkflowClient and also pass the same log level to DTF-python to capture DTF debug logs
  3. Standardization: The existing logs in DTF-python as well as the new logs to be added should be standardized to follow a standard schema. E.g. for the Workflow-Authoring logs, the format could be like TIME LEVEL WORKFLOW_ID SOURCE MESSAGE.

@shivamkm07
Copy link
Contributor

Following are some of the logging enhancements which should improve Workflow debuggability, w.r.t python-sdk

  1. Following log lines can be added to improve SDK logging:
    Workflow Authoring
    i. Scheduling activity: Scheduling activity {activity_name}
    ii. Creating timer: Creating timer to fire at {deadline}
    iii. Scheduling child workflow: Scheduling child-workflow {child_workflow_name}
    iv. Wait for external event: Waiting for the event {event_name} to be raised
    v. Continue-as-new: Continuing the execution as new instance
    Workflow Runtime:
    i. Register workflow: Registering workflow {workflow_name} with runtime
    ii. Register activity: Registering activity {activity_name} with workflow {workflow_name}
  2. Add support for Logger in DaprClient: Currently there is no logger initialized while starting the Dapr Client. Also there is no support for multiple log levels like INFO, DEBUG etc. Enable support in DaprClient as well as DaprWorkflowClient and also pass the same log level to DTF-python to capture DTF debug logs
  3. Standardization: The existing logs in DTF-python as well as the new logs to be added should be standardized to follow a standard schema. E.g. for the Workflow-Authoring logs, the format could be like TIME LEVEL WORKFLOW_ID SOURCE MESSAGE.

@DeepanshuA @RyanLettieri @cgillum thoughts?

@shivamkm07
Copy link
Contributor

/assign

@rabollin rabollin changed the title Logs enhancements - Structured logging and right log levels workflow Logs enhancements - Structured logging and right log levels Nov 1, 2023
@berndverst berndverst added this to the v1.13 milestone Nov 7, 2023
@berndverst
Copy link
Member

Please use the correct issue template when opening an issue.

@berndverst berndverst added kind/enhancement New feature or request dapr-ext-workflow and removed kind/bug Something isn't working labels Nov 7, 2023
@dapr-bot
Copy link
Collaborator

dapr-bot commented Jan 6, 2024

This issue has been automatically marked as stale because it has not had activity in the last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.

@dapr-bot dapr-bot added the stale Issue marked as stale by Dapr Bot label Jan 6, 2024
@mukundansundar mukundansundar removed the stale Issue marked as stale by Dapr Bot label Jan 10, 2024
@mukundansundar
Copy link
Contributor

closed via #645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants