Skip to main content

saddle_observability/
lib.rs

1//! Saddle structured logging and trace correlation.
2//!
3//! The V1 scope is Log and Trace only; the broader name does not imply Metrics
4//! or monitoring-platform delivery in V1. Framework components create an
5//! [`Observer`] once and use [`Observer::start_external_call`] and
6//! [`Observer::start_child_call`] around their async work. Records are queued
7//! without waiting for the output writer.
8
9mod calendar_writer;
10mod call;
11mod chain;
12mod diagnostic;
13pub use diagnostic::{
14    DiagnosticIoFailure, DiagnosticOutputSnapshot, DiagnosticShutdown, DiagnosticSubmission,
15    EMERGENCY_FILE_NAME, EmergencyDiagnosticHandle, EmergencyDiagnostics, EmergencyInitError,
16};
17mod event;
18#[doc(hidden)]
19#[allow(dead_code)] // Cross-crate candidate is consumed by the later Runtime integration slice.
20pub mod file;
21mod logger;
22mod metrics;
23mod production_fact;
24mod trace;
25
26pub use calendar_writer::{FileLoggingConfig, Rotation};
27pub use call::{ActiveCall, CallKind, CallOutcome};
28pub use chain::{
29    ActiveStage, BottleneckIdentity, CapacityDimension, CapacityObservation, ChainFieldError,
30    DatabaseDisposition, EventContext, Health, LifecycleState, LifecycleTimeoutStage,
31    OutboundAuthority, OutboundObservation, OutboundResult, RejectReason, RequestIdentity,
32    RouteIdentity, Stage, StageOutcome, TransactionOutcome, TransactionTerminalObservation,
33};
34pub use event::{
35    DomainEvent, DomainEventError, DomainValue, EventLevel, MAX_DOMAIN_EVENT_NAME_BYTES,
36    MAX_DOMAIN_FIELD_NAME_BYTES, MAX_DOMAIN_FIELDS, MAX_DOMAIN_PAYLOAD_BYTES,
37    MAX_DOMAIN_STRING_BYTES,
38};
39pub use logger::{
40    FlushError, FlushFuture, InitError, Observer, ObserverConfig, OutputStage, global, init,
41    init_file,
42};
43pub use metrics::{LATENCY_BUCKET_UPPER_MS, MetricsSnapshot};
44#[doc(hidden)]
45pub use production_fact::{
46    ObservabilityProductionFactError, ObservabilityProductionFactInput,
47    ObservabilitySourceCandidateInput, ObservabilitySourceCandidateRejection,
48    VerifiedObservabilitySourceCandidateOwner, bind_observability_source_candidate,
49    observability_production_fact_input, observability_source_candidate_input,
50};
51pub use saddle_core::{CallContext, SpanId, TraceCorrelationId, TraceId};
52pub use trace::{InboundTrace, TraceIdError, trace_id_from_hex};