Expand description
Boot-time app manifest emission to Eyes.
Telemetry shows what happened; the manifest tells Eyes what the app’s shape is: registered jobs, cron entries, build metadata, and optionally HTTP monitors. Apps normally send one manifest at process start.
Legacy emission is fire-and-forget: transport failures never fail boot, a
missing Tokio runtime produces a warning, and missing EYES_ORG_ID or
EYES_APP_ID makes sending a debug-logged no-op. State-aware builders add
synchronous declaration validation. Legacy manifests use monitors: None
(no monitor authority), while state-aware manifests use Some, including
Some([]) to authoritatively remove all monitors. The server-only rejection
of a target equal to the Eyes origin remains an asynchronously logged error.
§Intended call site
Call once at boot after constructing job and cron registries:
let _eyes_handle = cja::setup::setup_tracing("my-app")?;
let app_state = AppState::from_env().await?;
let cron_registry = cron_registry();
cja::eyes_manifest::send_boot_manifest::<Jobs, AppState>(
Some(env!("CARGO_PKG_VERSION")),
option_env!("VERGEN_GIT_SHA"),
Some(&cron_registry),
);app_version and git_sha are explicit because cja cannot read the
application’s compile-time environment. Pass None when unavailable.
Structs§
- AppManifest
- The shape of the application, as reported once at boot.
- Cron
Entry - A single cron registration: its name and schedule string.
- Dashboard
Link - One navigation link: rendered, never fetched.
- Dashboard
Section - One titled grouping of dashboard items.
- Expected
Process Role - Http
Monitor - Metric
Threshold Builder - The ergonomic Rust surface for declaring a metric threshold. All
validation happens in
MetricThresholdBuilder::build— no I/O, no server round trip. The builder does not enforce int-range on severity thresholds: the subscriber cannot know the referenced metric’svalue_type; out-of-domain values are rejected server-side at ingest. - Named
Dashboard - A semantic dashboard declaration carried by the boot manifest. A
dashboard carries zero query IR: every
stat/time_series/tableitem references a named metric declared in the same manifest byquery_id. - Named
Metric - A named metric declaration carried by the boot manifest.
- Named
Metric Builder - The ergonomic Rust surface for declaring a named metric.
- Process
Heartbeat - Process
Heartbeat Config - Process
Heartbeat Handle - Process
Identity
Enums§
- Boot
Manifest Declaration Error - A locally invalid HTTP monitor declaration.
- Dashboard
Item - One dashboard item: a typed presentation declaration. The wire form is
internally tagged on
kind(snake_case), pinned key-for-key by the manifest payload serialization test. - Http
Method - Manifest
Error - Error sending a boot manifest.
- Monitor
Target Error - Threshold
Comparison - Comparison direction of a metric-threshold severity policy.
Functions§
- build_
boot_ manifest - Build an
AppManifestfrom a job registry and (optionally) a cron registry. - build_
boot_ manifest_ from_ state - Builds and validates an authoritative manifest from application state.
- send_
boot_ manifest - Sends a legacy boot manifest to Eyes, fire-and-forget.
- send_
boot_ manifest_ from_ state - Sends an authoritative state-aware manifest. Use
::<Jobs, _>(&app_state, ...). - send_
manifest - Send a caller-built manifest to Eyes, fire-and-forget.