Expand description
Boot-time app manifest emission to Eyes.
Telemetry shows what happened; the manifest tells Eyes what the app’s
shape is — every registered job type, every cron entry with its schedule,
and the build version. Apps send one manifest at process start via
send_boot_manifest; each stored manifest doubles as a boot/deploy
marker on the Eyes server.
Emission is fire-and-forget: it spawns a background task, logs a warning
on failure, and never blocks or crashes app boot. When Eyes is not
configured (EYES_ORG_ID/EYES_APP_ID unset — the same variables
crate::setup::setup_tracing uses), it’s a debug-logged no-op.
§Intended call site
Call once at boot, after constructing your job/cron registries (they
don’t exist yet when setup_tracing runs, which is why this is a separate
explicit call):
async fn run() -> cja::Result<()> {
let _eyes_handle = setup_tracing("my-app")?;
let app_state = AppState::from_env().await?;
let cron_registry = cron_registry(); // your CronRegistry setup
cja::eyes_manifest::send_boot_manifest::<Jobs, AppState>(
Some(env!("CARGO_PKG_VERSION")),
option_env!("VERGEN_GIT_SHA"),
Some(&cron_registry),
);
// ... spawn server/job/cron workers as usual
}app_version and git_sha are explicit parameters: as a library, cja
cannot read your crate’s compile-time env, so source them at the app call
site (e.g. env!("CARGO_PKG_VERSION") and option_env!("VERGEN_GIT_SHA")
if you use vergen, matching what
crate::setup::setup_sentry uses for release detection). Pass None if
you don’t have them.
Structs§
- AppManifest
- The shape of the application, as reported once at boot.
- Cron
Entry - A single cron registration: its name and schedule string.
- Expected
Process Role - Http
Monitor
Enums§
- Http
Method - Manifest
Error - Error sending a boot manifest.
Functions§
- build_
boot_ manifest - Build an
AppManifestfrom a job registry and (optionally) a cron registry. - send_
boot_ manifest - Send this app’s boot manifest to Eyes, fire-and-forget.
- send_
manifest - Send a caller-built manifest to Eyes, fire-and-forget.