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

Improve Debug output for common new types #2579

Merged
merged 3 commits into from
Jan 30, 2025
Merged

Improve Debug output for common new types #2579

merged 3 commits into from
Jan 30, 2025

Conversation

Copy link

github-actions bot commented Jan 29, 2025

Test Results

  7 files  ±0    7 suites  ±0   4m 22s ⏱️ -30s
 47 tests ±0   46 ✅ +2  1 💤 ±0  0 ❌ ±0 
182 runs  ±0  179 ✅ +2  3 💤 ±0  0 ❌ ±0 

Results for commit d6aeb42. ± Comparison against base commit c61c551.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. +1 for merging.

For futures where we want to observe if the are too slow or overdue, this extension trait adds the ability to log with automatic exponential backoff on a certain tracing level, then optionally upgrade the level and reports once it crosses the "overdue" threshold.

## Usage:
```rust

use restate_futures_util::overdue::OverdueLoggingExt;

let result = my_future
  .log_slow_after(
    Duration::from_secs(1),
    tracing::Level::INFO,
    "Doing something important.",
  )
  // optional
  .with_overdue(
    Duration::from_secs(30),
    tracing::Level::WARN
).await;

// prints
// INFO "[slow] Doing something important. elapsed=1s");
// INFO "[slow] Doing something important. elapsed=2s");
// INFO "[slow] Doing something important. elapsed=4s");
// INFO "[slow] Doing something important. elapsed=8s");
// ...
// WARN "[overdue] Doing something important. elapsed=30s");
// WARN "[completed] Doing something important. elapsed=35.9s");

```
Some of the debug messages will likely be changed to trace before the release cut off date
@AhmedSoliman AhmedSoliman merged commit d6aeb42 into main Jan 30, 2025
27 of 29 checks passed
@AhmedSoliman AhmedSoliman deleted the pr2579 branch January 30, 2025 12:12
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.

2 participants