dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Ability to attach a local debugger to Local Temporal Worker #101

Open dhiaayachi opened 2 weeks ago

dhiaayachi commented 2 weeks ago

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.

dhiaayachi commented 22 hours ago

Debugging Temporal Workers: A Feature Request for Enhanced Debugging Capabilities

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.

dhiaayachi commented 21 hours ago

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.

dhiaayachi commented 21 hours ago

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:

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.

dhiaayachi commented 20 hours ago

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.

dhiaayachi commented 19 hours ago

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.

dhiaayachi commented 18 hours ago

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.

dhiaayachi commented 4 hours ago

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!