Skip to main content

Module eyes_manifest

Module eyes_manifest 

Source
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.
CronEntry
A single cron registration: its name and schedule string.
DashboardLink
One navigation link: rendered, never fetched.
DashboardSection
One titled grouping of dashboard items.
ExpectedProcessRole
HttpMonitor
MetricThresholdBuilder
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’s value_type; out-of-domain values are rejected server-side at ingest.
NamedDashboard
A semantic dashboard declaration carried by the boot manifest. A dashboard carries zero query IR: every stat/time_series/table item references a named metric declared in the same manifest by query_id.
NamedMetric
A named metric declaration carried by the boot manifest.
NamedMetricBuilder
The ergonomic Rust surface for declaring a named metric.
ProcessHeartbeat
ProcessHeartbeatConfig
ProcessHeartbeatHandle
ProcessIdentity

Enums§

BootManifestDeclarationError
A locally invalid HTTP monitor declaration.
DashboardItem
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.
HttpMethod
ManifestError
Error sending a boot manifest.
MonitorTargetError
ThresholdComparison
Comparison direction of a metric-threshold severity policy.

Functions§

build_boot_manifest
Build an AppManifest from 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.