Skip to content

Feature/debugging tools#64

Merged
hiking90 merged 2 commits intomainfrom
feature/phase1-debugging-tools
Jan 18, 2026
Merged

Feature/debugging tools#64
hiking90 merged 2 commits intomainfrom
feature/phase1-debugging-tools

Conversation

@hiking90
Copy link
Copy Markdown
Owner

Summary

  • Add dead letter tracking system with DeadLetterReason enum for diagnosing message delivery failures
  • Add actor performance metrics system for monitoring actor behavior
  • Migrate from log to tracing as required dependency (breaking change)
  • Add timeout support for blocking operations
  • Add Error::is_retryable() and Error::debugging_tips() helper methods

Breaking Changes

  • tracing is now a required dependency (previously log was required, tracing was optional)
  • The tracing feature flag now controls instrumentation only, not the logging system
  • blocking_tell signature changed: blocking_tell(msg)blocking_tell(msg, timeout: Option<Duration>)
  • blocking_ask signature changed: blocking_ask(msg)blocking_ask(msg, timeout: Option<Duration>)

…d migrate to tracing

BREAKING CHANGE:
- tracing is now a required dependency, replacing log crate
- blocking_tell/blocking_ask signatures changed to accept optional timeout

- Add DeadLetterReason enum to categorize message delivery failures
- Add Error::is_retryable() and Error::debugging_tips() helper methods
- Add test-utils feature with dead_letter_count() for testing
- Log all dead letters with structured tracing::warn! events
- Add optional timeout parameter to blocking_tell/blocking_ask
  - timeout: None uses blocking_send directly (most efficient)
  - timeout: Some(duration) spawns separate thread with bounded waiting
- Update all examples and tests to use tracing-subscriber

The tracing feature flag now controls instrumentation only (#[instrument]),
not the logging system itself.
Implement per-actor metrics collection behind a `metrics` feature flag:
- Lock-free MetricsCollector using AtomicU64 for minimal overhead
- MetricsSnapshot for message count, processing times, error count, uptime
- RAII guard for automatic processing time measurement
- ActorRef methods for accessing metrics (metrics(), message_count(), etc.)
- Documentation and example (metrics_demo.rs)
@hiking90 hiking90 merged commit d450249 into main Jan 18, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant