Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a49cef7
feat: introduce seatbelt crate
martintmk Jan 16, 2026
83e9b86
fixes
martintmk Jan 16, 2026
07b7f4e
fixes
martintmk Jan 16, 2026
299aa75
sort
martintmk Jan 16, 2026
a5bc1cf
fixes
martintmk Jan 16, 2026
ed0a1c1
fixies
martintmk Jan 16, 2026
3a32ce1
fixes
martintmk Jan 16, 2026
d3b2ca7
fixes
martintmk Jan 16, 2026
3bf81b6
fixes
martintmk Jan 16, 2026
32fea51
format
martintmk Jan 16, 2026
5b6b54b
fixes
martintmk Jan 16, 2026
3a06b5a
rename CircuitBreaker to just Circuit
martintmk Jan 19, 2026
9267c87
cleanup
martintmk Jan 19, 2026
9a74869
rename SeatbeltOptions to Context
martintmk Jan 19, 2026
f4aa475
cleanup
martintmk Jan 19, 2026
e2fe66c
spelling fixes
martintmk Jan 19, 2026
88c6bbc
clipy and fmt
martintmk Jan 19, 2026
e7c2aff
license headers
martintmk Jan 19, 2026
ae01de4
fixes
martintmk Jan 19, 2026
5817ba1
Merge remote-tracking branch 'origin/main' into u/mtomka/seatbelt
martintmk Jan 19, 2026
320d404
fixes
martintmk Jan 19, 2026
6d40b71
cleanup
martintmk Jan 19, 2026
5057b59
refine the features
martintmk Jan 19, 2026
ba87231
refine the features
martintmk Jan 19, 2026
cc1aa9c
PR comments
martintmk Jan 19, 2026
cc28b68
fixes
martintmk Jan 19, 2026
45155d4
update library docs
martintmk Jan 19, 2026
6cecc79
improvements
martintmk Jan 19, 2026
92ec61c
fixes
martintmk Jan 19, 2026
cf70a2c
reorganize the crate modules
martintmk Jan 20, 2026
3a1ce82
fixes
martintmk Jan 20, 2026
ac69bad
test fixes
martintmk Jan 20, 2026
1ab0731
cleanup
martintmk Jan 20, 2026
7c11ecc
fixes
martintmk Jan 20, 2026
1fa6edc
fixes
martintmk Jan 20, 2026
a646f4e
cleanup
martintmk Jan 20, 2026
dfb2bb2
fixes
martintmk Jan 20, 2026
9298bbf
fixes
martintmk Jan 20, 2026
d0be79c
Merge remote-tracking branch 'origin/main' into u/mtomka/seatbelt
martintmk Jan 20, 2026
850d8e6
cleanup
martintmk Jan 20, 2026
98f7bef
fixes
martintmk Jan 20, 2026
6ac0b23
icons
martintmk Jan 20, 2026
2c63f37
new tests
martintmk Jan 20, 2026
a51cb0b
fixes
martintmk Jan 20, 2026
afc1012
more tests
martintmk Jan 20, 2026
8a98c9b
cleanup
martintmk Jan 20, 2026
3fc1a0b
cleanup
martintmk Jan 20, 2026
ec8f6f8
fixes
martintmk Jan 20, 2026
2550c45
kill mutants
martintmk Jan 20, 2026
74e85f0
rename Context to PipelineContext
martintmk Jan 21, 2026
fa2f124
rename circuit to circuit_breaker
martintmk Jan 21, 2026
ebf0672
cleanup
martintmk Jan 21, 2026
4eda7fd
spelling
martintmk Jan 21, 2026
989784e
doc updates
martintmk Jan 21, 2026
b061a78
improve docs
martintmk Jan 21, 2026
9d1f4c6
Merge remote-tracking branch 'origin/main' into u/mtomka/seatbelt
martintmk Jan 21, 2026
d2bafe3
fixes
martintmk Jan 21, 2026
64cfbb9
address PR feedeback
martintmk Jan 22, 2026
ba35794
PR comments
martintmk Jan 22, 2026
3587a9e
cleanup
martintmk Jan 22, 2026
52a6cbd
type state concisenes
martintmk Jan 22, 2026
f73a666
cleanup
martintmk Jan 22, 2026
b0a20e7
PR comments
martintmk Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ interop
Interop
interoperability
interoperate
jitter
IOCP
IP
Kubernetes
Expand Down Expand Up @@ -181,6 +182,7 @@ non-mockable
ns
nuget
NUMA
observability
ohno
ok
Ok
Expand Down Expand Up @@ -212,6 +214,7 @@ repo
repos
Reqwest
Reusability
RPC
runtime
runtimes
rustc
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Please see each crate's change log below:
- [`ohno`](./crates/ohno/CHANGELOG.md)
- [`ohno_macros`](./crates/ohno_macros/CHANGELOG.md)
- [`recoverable`](./crates/recoverable/CHANGELOG.md)
- [`seatbelt`](./crates/seatbelt/CHANGELOG.md)
- [`thread_aware`](./crates/thread_aware/CHANGELOG.md)
- [`thread_aware_macros`](./crates/thread_aware_macros/CHANGELOG.md)
- [`thread_aware_macros_impl`](./crates/thread_aware_macros_impl/CHANGELOG.md)
Expand Down
91 changes: 91 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ layered = { path = "crates/layered", default-features = false, version = "0.2.0"
ohno = { path = "crates/ohno", default-features = false, version = "0.2.1" }
ohno_macros = { path = "crates/ohno_macros", default-features = false, version = "0.2.0" }
recoverable = { path = "crates/recoverable", default-features = false, version = "0.1.0" }
seatbelt = { path = "crates/seatbelt", default-features = false, version = "0.2.0" }
testing_aids = { path = "crates/testing_aids", default-features = false }
thread_aware = { path = "crates/thread_aware", default-features = false, version = "0.6.1" }
thread_aware_macros = { path = "crates/thread_aware_macros", default-features = false, version = "0.6.1" }
Expand All @@ -51,9 +52,11 @@ criterion = { version = "0.7.0", default-features = false }
derive_more = { version = "2.0.1", default-features = false }
duct = { version = "1.1.1", default-features = false }
dynosaur = { version = "0.3.0", default-features = false }
fastrand = { version = "2.3.0", default-features = false, features = ["std"] }
futures = { version = "0.3.31", default-features = false }
futures-core = { version = "0.3.31", default-features = false }
futures-util = { version = "0.3.31", default-features = false }
http = { version = "1.2.0", default-features = false, features = ["std"] }
infinity_pool = { version = "0.8.1", default-features = false }
insta = { version = "1.44.1", default-features = false }
jiff = { version = "0.2.16", default-features = false }
Expand All @@ -65,6 +68,9 @@ new_zealand = { version = "1.0.1", default-features = false }
nm = { version = "0.1.21", default-features = false }
num-traits = { version = "0.2.19", default-features = false }
once_cell = { version = "1.21.3", default-features = false }
opentelemetry = { version = "0.31.0", default-features = false }
opentelemetry-stdout = { version = "0.31.0", default-features = false }
opentelemetry_sdk = { version = "0.31.0", default-features = false }
pin-project-lite = { version = "0.2.13", default-features = false }
pretty_assertions = { version = "1.4.1", default-features = false }
prettyplease = { version = "0.2.37", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ These are the crates built out of this repo:
- [`ohno`](./crates/ohno/README.md) - High-quality Rust error handling.
- [`ohno_macros`](./crates/ohno_macros/README.md) - Macros for the `ohno` crate.
- [`recoverable`](./crates/recoverable/README.md) - Recovery information and classification for resilience patterns.
- [`seatbelt`](./crates/seatbelt/README.md) - Resilience and recovery mechanisms for fallible operations.
- [`thread_aware`](./crates/thread_aware/README.md) - Facilities to support thread-isolated state.
- [`thread_aware_macros`](./crates/thread_aware_macros/README.md) - Macros for the `thread_aware` crate.
- [`thread_aware_macros_impl`](./crates/thread_aware_macros_impl/README.md) - Macros for the `thread_aware` crate.
Expand Down
2 changes: 1 addition & 1 deletion crates/layered/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(
not(all(feature = "intercept", feature = "tower-service", feature = "dynamic-service")),
expect(rustdoc::broken_intra_doc_links)
expect(rustdoc::broken_intra_doc_links, reason = "simpler docs")
)]
#![doc(html_logo_url = "https://media.githubusercontent.com/media/microsoft/oxidizer/refs/heads/main/crates/layered/logo.png")]
#![doc(html_favicon_url = "https://media.githubusercontent.com/media/microsoft/oxidizer/refs/heads/main/crates/layered/favicon.ico")]
Expand Down
14 changes: 14 additions & 0 deletions crates/seatbelt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

## [0.2.0] - 2026-01-20

Initial release.

- ✨ Features

- Timeout middleware for canceling long-running operations
- Retry middleware with constant, linear, and exponential backoff strategies
- Circuit breaker middleware with health-based failure detection and gradual recovery
- OpenTelemetry metrics integration (`metrics` feature)
- Structured logging via tracing (`logs` feature)
- Shared `Context` for clock and telemetry configuration
118 changes: 118 additions & 0 deletions crates/seatbelt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

[package]
name = "seatbelt"
description = "Resilience and recovery mechanisms for fallible operations."
version = "0.2.0"
readme = "README.md"
keywords = ["oxidizer", "resilience", "layered", "recovery", "retry", "circuit-breaker"]
categories = ["data-structures"]

edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[package.metadata.cargo_check_external_types]
allowed_external_types = [
"layered::layer::stack::Stack",
"layered::service::Service",
"opentelemetry::metrics::meter::MeterProvider",
"recoverable::Recovery",
"recoverable::RecoveryInfo",
"recoverable::RecoveryKind",
"tick::clock::Clock",
"tower_layer::Layer",
]

[package.metadata.docs.rs]
all-features = true

[features]
default = []
timeout = []
retry = ["dep:fastrand"]
circuit-breaker = ["dep:fastrand"]
metrics = ["dep:opentelemetry", "opentelemetry/metrics"]
logs = ["dep:tracing"]

[dependencies]
fastrand = { workspace = true, optional = true }
futures = { workspace = true }
layered = { workspace = true }
opentelemetry = { workspace = true, optional = true }
recoverable = { workspace = true }
tick = { workspace = true }
tracing = { workspace = true, optional = true }

[dev-dependencies]
alloc_tracker.workspace = true
criterion.workspace = true
fastrand.workspace = true
futures = { workspace = true, features = ["executor"] }
http.workspace = true
layered = { workspace = true }
mutants.workspace = true
ohno = { workspace = true, features = ["app-err"] }
opentelemetry = { workspace = true, default-features = false, features = ["metrics"] }
opentelemetry-stdout = { workspace = true, default-features = false, features = ["metrics", "logs"] }
opentelemetry_sdk = { workspace = true, default-features = false, features = ["metrics", "testing", "experimental_metrics_custom_reader"] }
static_assertions.workspace = true
tick = { workspace = true, features = ["test-util", "tokio"] }
tokio = { workspace = true, features = ["rt", "macros"] }
tracing.workspace = true
tracing-subscriber = { workspace = true, features = ["fmt", "std"] }

[[example]]
name = "timeout"
required-features = ["timeout"]

[[example]]
name = "timeout_advanced"
required-features = ["timeout"]

[[example]]
name = "retry"
required-features = ["retry"]

[[example]]
name = "retry_advanced"
required-features = ["retry"]

[[example]]
name = "retry_outage"
required-features = ["retry"]

[[example]]
name = "resilience_pipeline"
required-features = ["retry", "timeout"]

[[example]]
name = "circuit_breaker"
required-features = ["circuit-breaker", "metrics"]

[[bench]]
name = "observability"
harness = false
required-features = ["retry", "logs", "metrics"]

[[bench]]
name = "timeout"
harness = false
required-features = ["timeout"]

[[bench]]
name = "retry"
harness = false
required-features = ["retry"]

[[bench]]
name = "circuit_breaker"
harness = false
required-features = ["circuit-breaker"]

[lints]
workspace = true
Loading
Loading