sentinel_core/lib.rs
1//! sentinel-core: core library for perf-sentinel.
2//!
3//! Provides the analysis pipeline for detecting performance anti-patterns
4//! in runtime traces (SQL queries, HTTP calls).
5
6// This crate contains no `unsafe` code and is meant to stay that way: the
7// analysis pipeline is pure data processing. `forbid` (not `deny`) so the
8// guarantee cannot be locally overridden by an inner `allow`. Every
9// `unsafe` FFI call in the workspace lives in the CLI crate, where each
10// one is isolated and documented with its SAFETY invariants.
11#![forbid(unsafe_code)]
12#![warn(clippy::pedantic)]
13#![allow(clippy::cast_possible_truncation)] // u128 -> u64 for elapsed_ms
14#![allow(clippy::cast_precision_loss)] // usize -> f64 for ratios
15#![allow(clippy::similar_names)] // min_ts/min_ms, max_ts/max_ms are clear
16
17pub mod acknowledgments;
18pub mod calibrate;
19#[cfg(feature = "daemon")]
20pub mod capture;
21pub mod config;
22pub mod correlate;
23#[cfg(feature = "daemon")]
24pub mod daemon;
25pub mod detect;
26pub mod diff;
27pub mod event;
28pub mod explain;
29#[cfg(any(feature = "daemon", feature = "tempo", feature = "jaeger-query"))]
30pub mod http_client;
31pub mod ingest;
32pub mod normalize;
33pub mod pipeline;
34pub mod quality_gate;
35pub mod report;
36pub mod score;
37#[cfg(any(feature = "daemon", feature = "tempo"))]
38pub(crate) mod shutdown;
39// Hidden: benchmark and fixture tooling, not a supported library API.
40#[doc(hidden)]
41pub mod synth;
42pub mod text_safety;
43pub(crate) mod time;
44
45#[cfg(test)]
46pub(crate) mod test_helpers;
47
48// Re-export the interpretation helper so the CLI and downstream consumers
49// can write `sentinel_core::InterpretationLevel::for_iis(...)` without
50// having to know it lives under `report::interpret::`.
51pub use report::interpret::InterpretationLevel;
52
53// Re-export the daemon error types for consistency with `InterpretationLevel`.
54// Downstream consumers (the CLI, any library user) can write
55// `sentinel_core::DaemonError` / `sentinel_core::TlsConfigError` without
56// having to know the module structure. Gated on `daemon` since the daemon
57// module itself is gated.
58#[cfg(feature = "daemon")]
59pub use daemon::{DaemonError, TlsConfigError};