Skip to content
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b1ff66b
feat(oxidizer_health): add application health aggregation
wukchung Nov 23, 2026
938b0de
docs(oxidizer_health): introduce readiness with a quick start
wukchung Nov 23, 2026
e82535b
docs(oxidizer_health): show how to publish and diagnose health changes
wukchung Nov 23, 2026
94963cc
docs(oxidizer_health): distinguish publishers from health states
wukchung Nov 23, 2026
6d43428
refactor(oxidizer_health): aggregate component changes on one worker
wukchung Nov 23, 2026
a3f3380
chore(oxidizer_health): declare external types used by public handles
wukchung Nov 23, 2026
fc941d9
fix(oxidizer_health): keep orphaned signals local and wait for batch …
wukchung Nov 23, 2026
37d7e88
test(oxidizer_health): verify worker progress, teardown, and health t…
wukchung Nov 23, 2026
a908043
fix(oxidizer_health): keep filtered diagnostics out of debug output
wukchung Nov 23, 2026
19f799a
chore(oxidizer_health): sort the workspace dependency
wukchung Nov 23, 2026
792a01e
fix(oxidizer_health): keep readiness false across overlapping failures
wukchung Nov 23, 2026
8016eff
docs(oxidizer_health): link the startup example to Aggregator
wukchung Nov 23, 2026
9b22b0d
test(oxidizer_health): verify coalesced readiness and publisher removal
wukchung Nov 23, 2026
0a37630
test(oxidizer_health): detect an invalid self-join without blocking
wukchung Nov 23, 2026
3f8c81b
docs(oxidizer_health): clarify aggregation and readiness examples
wukchung Nov 24, 2026
6f6998c
docs(oxidizer_health): focus README on aggregation
wukchung Nov 24, 2026
71ddb91
refactor(oxidizer_health): rename HTTP readiness module to kubernetes…
wukchung Nov 24, 2026
82b9184
test(oxidizer_health): observe worker progress without mutation watch…
wukchung Nov 24, 2026
dee639f
fix(oxidizer_health): prevent false readiness across failures and rem…
wukchung Nov 24, 2026
0e43b94
perf(oxidizer_health): group diagnostics only when requested
wukchung Nov 24, 2026
2e81f77
fix(oxidizer_health): release queued signals and wake readers when th…
wukchung Nov 24, 2026
b60ae13
refactor(oxidizer_health): send registration directly to the worker
wukchung Nov 24, 2026
74d08d5
test(oxidizer_health): wait for a later worker turn before observing …
wukchung Nov 25, 2026
28afbfb
fix(oxidizer_health): declare HTTP adapter types for release planning
wukchung Nov 25, 2026
b79ade9
docs(oxidizer_health): distinguish terminal readiness from retained r…
wukchung Nov 25, 2026
73300d1
docs(oxidizer_health): keep startup unready until initialization succ…
wukchung Nov 25, 2026
7ceecd6
docs(oxidizer_health): clarify filter visibility and snapshot lifetime
wukchung Nov 25, 2026
1b17dd7
test(oxidizer_health): map terminal-state mutation to the cursor cont…
wukchung Nov 25, 2026
acacd0f
feat(oxidizer_health): add application health framework
wukchung Nov 26, 2026
0b8e85d
style(oxidizer_health): format report example
wukchung Nov 26, 2026
702e2c8
fix(oxidizer_health): construct foldhash maps with defaults
wukchung Nov 26, 2026
a10a20a
style(oxidizer_health): elide attribute value lifetimes
wukchung Nov 26, 2026
475acec
test(oxidizer_health): simplify monitor ownership
wukchung Nov 26, 2026
aba3e51
test(oxidizer_health): align monitor mutability
wukchung Nov 26, 2026
22ab722
style(oxidizer_health): sort crate manifest
wukchung Nov 26, 2026
d873192
test(oxidizer_health): use a fresh terminal monitor cursor
wukchung Nov 26, 2026
c28dfbe
test(oxidizer_health): cover typed attributes and report display
wukchung Nov 26, 2026
48ef1be
test(oxidizer_health): cover typed boolean attributes
wukchung Nov 26, 2026
4bb9e97
test(oxidizer_health): cover clone and retirement contracts
wukchung Nov 26, 2026
d32ed91
test(oxidizer_health): fail ownership mutants promptly
wukchung Nov 26, 2026
ded8609
test(oxidizer_health): map ownership mutants to focused contracts
wukchung Nov 26, 2026
cbf70d8
style(oxidizer_health): format report display test
wukchung Nov 26, 2026
341fe1c
feat(oxidizer_health): finalize application health framework
wukchung Nov 26, 2026
a1eb73d
docs(oxidizer_health): clarify framework and readiness timing
wukchung Nov 26, 2026
2e5ca60
docs(oxidizer_health): clarify framework and readiness timing
wukchung Nov 26, 2026
cae3b0f
refactor(health): rename crate and use observed telemetry
wukchung Nov 27, 2026
4aacef3
chore(health): join transferred pull request history
wukchung Nov 27, 2026
fd628e6
test(health): use future assertion helpers
wukchung Nov 27, 2026
c6698f2
style(health): sort workspace dependency
wukchung Nov 27, 2026
787f422
fix(process_health): use publishable package identity
wukchung Nov 27, 2026
38882f2
fix(process_health): keep report iterator contract minimal
wukchung Nov 27, 2026
7f11776
fix(process_health): emit worker termination on exit
wukchung Nov 27, 2026
4aca8f7
refactor(process_health): simplify diagnostics API
wukchung Nov 27, 2026
ed07ab5
fix(process_health): use path-only test dependency
wukchung Nov 27, 2026
ab35ef8
docs(process_health): qualify publisher drop behavior
wukchung Nov 27, 2026
4394b75
test(process_health): close mutation coverage gaps
wukchung Nov 27, 2026
e253699
chore(process_health): merge main to resolve conflicts
wukchung Nov 27, 2026
e61ab96
test(process_health): await equal-signal worker turn
wukchung Nov 27, 2026
c2c058c
test(process_health): synchronize worker failure observation
wukchung Nov 27, 2026
7306581
test(process_health): bound mutation waits
wukchung Nov 27, 2026
717361a
test(process_health): refresh Gamma hints
wukchung Nov 27, 2026
881ab38
test(process_health): use fast Gamma oracles
wukchung Nov 27, 2026
7c31c25
test(process_health): map Gamma to fast oracles
wukchung Nov 27, 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
15 changes: 15 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ azure_identity = { version = "1.0.0", default-features = false }
azure_storage_blob = { version = "1.0.0", default-features = false }
backtrace = { version = "0.3.76", default-features = false }
base64 = { version = "0.23.0", default-features = false, features = ["alloc"] }
bitflags = { version = "2.13.2", default-features = false }
bolero = { version = "0.13.4", default-features = false }
bon = { version = "3.10.3", default-features = false }
brotli = { version = "9.0.0", default-features = false }
Expand Down Expand Up @@ -220,6 +221,7 @@ opentelemetry = { version = "0.33.0", default-features = false }
opentelemetry-semantic-conventions = { version = "0.33.0", default-features = false }
opentelemetry_sdk = { version = "0.33.0", default-features = false }
opool = { version = "0.2.0", default-features = false }
oxidizer_health = { path = "crates/oxidizer_health", default-features = false, version = "0.1.0" }
parking_lot = { version = "0.13.0", default-features = false }
paste = { package = "pastey", version = "0.2.3", default-features = false }
path-tree = { version = "0.8.3", 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 @@ -57,6 +57,7 @@ These are the primary crates built out of this repo:
- [`observed_destination_memory`](./crates/observed_destination_memory/README.md) - In-memory destination for Observed pipeline.
- [`observed_destination_stdout`](./crates/observed_destination_stdout/README.md) - stdout destination for Observed pipeline.
- [`ohno`](./crates/ohno/README.md) - High-quality Rust error handling.
- [`oxidizer_health`](./crates/oxidizer_health/README.md) - Application health aggregation with component reports.
- [`performables`](./crates/performables/README.md) - Thread-aware synchronization and ownership primitives.
- [`plurality`](./crates/plurality/README.md) - A highly efficient pooling memory allocator.
- [`rallocator`](./crates/rallocator/README.md) - Windows, Linux and macOS x64/ARM64 owner-return allocator with Seismograph allocation events.
Expand Down
42 changes: 42 additions & 0 deletions crates/oxidizer_health/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.

[package]
name = "oxidizer_health"
description = "Application health aggregation with component reports."
version = "0.1.0"
readme = "README.md"
keywords = ["health", "readiness", "diagnostics"]
categories = ["asynchronous"]
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
include.workspace = true
repository = "https://github.com/microsoft/oxidizer/tree/main/crates/oxidizer_health"

[package.metadata.cargo_check_external_types]
# Thread-aware handles.
allowed_external_types = ["thread_aware_core::thread_aware::ThreadAware"]

[features]
default = []

[dependencies]
arc-swap.workspace = true
foldhash = { workspace = true, features = ["std"] }
performables.workspace = true
thread_aware = { workspace = true, features = ["std"] }
tracing.workspace = true
Comment thread
wukchung marked this conversation as resolved.
Resolved

[dev-dependencies]
ctor.workspace = true
futures = { workspace = true, features = ["executor"] }
static_assertions.workspace = true
testing_aids = { path = "../testing_aids" }

# >>> anvil-managed: anvil-lints
[lints]
workspace = true
# <<< anvil-managed: anvil-lints
124 changes: 124 additions & 0 deletions crates/oxidizer_health/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<div align="center">
<img src="https://raw.githubusercontent.com/microsoft/oxidizer/refs/heads/main/logo.svg" alt="Oxidizer Health Logo" width="96">

# Oxidizer Health

[![crate.io](https://img.shields.io/crates/v/oxidizer_health.svg)](https://crates.io/crates/oxidizer_health)
[![docs.rs](https://docs.rs/oxidizer_health/badge.svg)](https://docs.rs/oxidizer_health)
[![MSRV](https://img.shields.io/crates/msrv/oxidizer_health)](https://crates.io/crates/oxidizer_health)
[![CI](https://github.com/microsoft/oxidizer/actions/workflows/anvil-pr.yml/badge.svg)](https://github.com/microsoft/oxidizer/actions/workflows/anvil-pr.yml)
[![Coverage](https://codecov.io/gh/microsoft/oxidizer/graph/badge.svg?token=FCUG0EL5TI)](https://codecov.io/gh/microsoft/oxidizer)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/microsoft/oxidizer/blob/main/LICENSE)
<a href="https://github.com/microsoft/oxidizer"><img src="https://raw.githubusercontent.com/microsoft/oxidizer/refs/heads/main/logo.svg" alt="This crate was developed as part of the Oxidizer project" width="20"></a>

</div>

Health signal collection and aggregation for Rust services.

[`Publisher`][__link0]s collect application-defined health signals into named [`Component`][__link1]s.
Each component aggregates its publishers, and an [`Aggregator`][__link2] combines the components into
an overall service state: [`Healthy`][__link3], [`Degraded`][__link4], or
[`Unhealthy`][__link5]. At each level, the worst state wins.
[Reports][__link6] retain diagnostic attributes and publisher counts.

## Quick start

Create an [`Aggregator`][__link7], register an application-defined component, and publish a health signal.
[`Aggregator::component`][__link8] creates the named component on first use; subsequent calls with the
same name return a handle to that component. The name identifies a subsystem, not a built-in check.

```rust
use oxidizer_health::{Aggregator, Health};

let aggregator = Aggregator::new();
let backend = aggregator.component("backend");
let mut monitor = aggregator.monitor();
let mut publisher = backend.publisher();

publisher.degraded("connection pool exhausted");
while monitor.state() != Health::Degraded {
monitor.changed().await;
}
assert_eq!(monitor.state(), Health::Degraded);
```

Publishing updates the local [`Signal`][__link9] immediately. Aggregation runs in the background.
Several updates can produce one [`Monitor::changed`][__link10] notification. Read the latest state
or reports after each notification rather than counting transitions.

The loop waits for `Degraded`. If the worker stops or fails to start, readiness is `Unhealthy`.
A monitor created after that receives no notification.
If a wait must end even when the target state is unreachable, use a timeout or cancellation.

Dropping a publisher removes its contribution. A component unregisters after its last
[`Component`][__link11] handle and publisher drop. A component without publishers is `Unhealthy`, as is
an [`Aggregator`][__link12] without components.

## Diagnose a change

A read-only [`Monitor`][__link13] provides component reports independently of publishers.
This example publishes a problem, waits for aggregation, and prints its diagnostic signal:

```rust
use oxidizer_health::{Aggregator, Health};

let aggregator = Aggregator::new();
let backend = aggregator.component("backend");
let mut monitor = aggregator.monitor();
let mut publisher = backend.publisher();
publisher.degraded("connection pool exhausted");
while monitor.state() != Health::Degraded {
monitor.changed().await;
}

for report in monitor.reports().await {
println!("{report}");
for state in [Health::Degraded, Health::Unhealthy] {
for (signal, count) in report.signals(state) {
println!(" {signal} ({count} publishers)");
}
}
}
```

Reports group identical signals and count their publishers. Call [`Report::signals`][__link14] for the
severity that the diagnostic consumer needs.
An empty component has an `Unhealthy` summary with no signals. For continuous observation,
read the reports, await [`Monitor::changed`][__link15], and repeat.

## Additional documentation

* Register a [`Component`][__link16] with [`Aggregator::component`][__link17] and report changes with [`Publisher::publish`][__link18].
* Get a read-only [`Monitor`][__link19] with [`Aggregator::monitor`][__link20] to observe changes independently of publishers.
* Select diagnostic signals by [`Health`][__link21] and inspect their attributes and publisher counts with [`Report::signals`][__link22].


<hr/>
<sub>
This crate was developed as part of <a href="https://github.com/microsoft/oxidizer">The Oxidizer Project</a>. Browse this crate's <a href="https://github.com/microsoft/oxidizer/tree/main/crates/oxidizer_health">source code</a>.
</sub>

[__cargo_doc2readme_dependencies_info]: ggGmYW0CYXZlMC43LjNhdIQborR2_k_xJd4bTcf2krrNPIcbP72Pw1UdRjkbim_eMDe2BBthYvRhcoQbSX6wJo1Ap_4bWaAmdlZIPP8bVKDzQuyx5WAbhQusGn3q2FphZIGCb294aWRpemVyX2hlYWx0aGUwLjEuMA
[__link0]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Publisher
[__link1]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Component
[__link10]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Monitor::changed
[__link11]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Component
[__link12]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Aggregator
[__link13]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Monitor
[__link14]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Report::signals
[__link15]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Monitor::changed
[__link16]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Component
[__link17]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Aggregator::component
[__link18]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Publisher::publish
[__link19]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Monitor
[__link2]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Aggregator
[__link20]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Aggregator::monitor
[__link21]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Health
[__link22]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Report::signals
[__link3]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Health::Healthy
[__link4]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Health::Degraded
[__link5]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Health::Unhealthy
[__link6]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Report
[__link7]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Aggregator
[__link8]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Aggregator::component
[__link9]: https://docs.rs/oxidizer_health/0.1.0/oxidizer_health/?search=Signal
Loading
Loading