Open dhiaayachi opened 2 weeks ago
This issue proposes a valuable feature for debugging Temporal Workers locally. The current debugging functionality provided by the Temporal Web UI often falls short when pinpointing the root cause of issues in complex applications. This feature request aims to address this by allowing developers to attach a debugger to a running Temporal Worker, providing more granular debugging capabilities.
Problem:
The Temporal Web UI, while helpful for monitoring and general overview, lacks the granular debugging capabilities required for complex issue analysis. It doesn't offer the ability to step through the Worker's execution flow, inspect variable values, or set breakpoints at specific points in the code.
Solution:
The proposed solution is to introduce a mechanism that exposes a debugging port on the Temporal Worker, allowing developers to attach a debugger from their IDEs like JetBrains products or VS Code. This will allow developers to:
Benefits:
Implementation Considerations:
References:
This proposed feature would be a welcome addition to Temporal's debugging capabilities, providing developers with more advanced tools for troubleshooting complex issues and improving the overall development experience.
Thanks for reporting this issue!
The Temporal Web UI doesn't have enough debugging features for tracing local worker execution, and unfortunately we don't have any built-in debugging features for the .NET SDK. Here is how you could debug locally:
Let me know if you have any other questions.
Thanks for reaching out! We appreciate your feedback about the need for more robust debugging capabilities when working with Temporal Workers locally.
While the Temporal Web UI can provide some insight into Workflow Execution, we understand that a debugger is often a much more powerful tool for identifying and resolving issues.
At present, directly attaching a debugger to a Temporal Worker is not a supported feature within the Temporal ecosystem. The deterministic nature of Workflows and the distributed nature of Temporal mean that traditional debugging approaches are not directly applicable.
To address this limitation, here are some suggestions that may help you debug your application more effectively:
Logging: Leverage extensive logging in your Workflow and Activity code. This can provide detailed information about the execution path and the values of variables at various points in the process. You can configure logging to your preferred destinations such as a file or a remote logging service.
Tracing: Use OpenTelemetry tracing capabilities to track the execution flow of your Workflows, Activities, and other components. OpenTelemetry can visualize dependencies and execution times, helping you pinpoint areas where errors might occur.
Replay: Use Temporal's Replay feature to rerun your Workflows with the same Event History as a specific execution. Replay allows you to analyze the complete execution history and understand why a Workflow went wrong.
Unit Testing: Write unit tests for both your Workflows and Activities. These tests can help identify and isolate bugs at the function level, making it easier to diagnose issues.
Activity Retry Simulator: Use the Activity Retry Simulator to help understand the impact of retries on your Activity executions. This can be particularly helpful for debugging scenarios where Activity failures are occurring.
We hope these suggestions help you find a workable solution for your debugging needs while working with Temporal Workers locally. We are continually working to improve the developer experience with Temporal, and your feedback is valuable for us as we plan future features.
Thanks for the feature request!
The current Temporal Web UI and CLI are sufficient to debug your worker, but we understand the desire for a more interactive debugger. You can work around the limitations of the web UI by using a standard debugger with the Temporal Server running in the background. You can set breakpoints and step through your code to trace the execution flow of your worker.
Let us know if you have any other questions.
Thanks for reporting this! The Temporal Web UI is not intended to be a full-fledged debugger.
For a local development environment, it's recommended to use a debugger tool provided by your favorite IDE, like JetBrains or VS Code. You can set the TEMPORAL_DEBUG
environment variable to true
before debugging your Workflow Definition, which will help alleviate the issue of deadlock detection.
The Debugging section of the .NET SDK feature guide has more information about debugging Workflows in development and production environments.
Thanks for reporting this. I understand you are looking for a way to debug your Temporal worker locally and are finding the Temporal Web UI insufficient.
The Temporal .NET SDK documentation does cover debugging in a development environment in this section.
If you have more information about the specific debugger you're using, I can help you with more specific instructions.
Thanks for the feature request. We understand the need for a local debugging experience for Temporal Workers and it's something we are actively considering for future releases.
In the meantime, you can leverage the following to debug your Worker:
Let us know if you have any other questions or feedback!
Is your feature request related to a problem? Please describe. When testing a Temporal Worker locally, I would like the ability to expose a port and attach a debugger (either in a JetBrains product or VSCode) that allows me to trace each step the Worker takes. The debugging functionality provided by the Temporal Web UI is not sufficient in the slightest to trace where/why the application bugged out.