Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive tracing feature to the Cano workflow library and makes the scheduler module optional. The tracing integration provides detailed observability into workflow execution using the tracing library, while the optional scheduler reduces core dependencies for users who don't need scheduling capabilities.
- Integrated the
tracinglibrary with custom span support for workflows and concurrent workflows - Added optional tracing instrumentation to all key components (workflows, nodes, tasks, scheduler)
- Made the scheduler module optional behind a
schedulerfeature flag - Added granular feature flags (
tracing,scheduler,all) for better dependency management
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/workflow.rs | Added tracing span support and instrumentation to Workflow and ConcurrentWorkflow |
| src/tracing_tests.rs | New test module for validating tracing integration functionality |
| src/task.rs | Added tracing instrumentation to task execution and retry logic |
| src/scheduler.rs | Added tracing to scheduler workflow executions with workflow context |
| src/node.rs | Added detailed tracing to node execution phases (prep, exec, post) |
| src/lib.rs | Made scheduler module optional and updated public API exports |
| examples/tracing_demo.rs | New comprehensive example demonstrating tracing capabilities |
| examples/scheduler_*.rs | Added feature gates to scheduler examples |
| README.md | Updated documentation with tracing usage and feature flag information |
| Cargo.toml | Added feature flags and optional dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ New
tracingFeature:tracinglibrary to provide detailed observability into workflow execution.with_tracing_spanmethods toWorkflowandConcurrentWorkflowto allow users to attach custom tracing spans.prep,exec,post) and retry attempts.tracing_demoexample to showcase the latest capabilities.tracing_teststo validate the integration.📦 Optional Scheduler:
schedulermodule is now an optional feature. To use it, enable theschedulerfeature inCargo.toml.required-features = ["scheduler"].🔧 Build & Configuration:
tracing,scheduler, andallfeature flags toCargo.toml.tokiodependencies to be more granular, reducing unused features for minimal builds.How to Use the
tracingFeatureEnable the feature in Cargo.toml:
Initialize a tracing subscriber:
Attach a custom span to a workflow:
All operations within the workflow will now be traced under the provided span, offering rich, structured logs for debugging and monitoring.
This PR significantly improves the library's utility for building robust, observable, and modular applications.