osproxy_observe/lib.rs
1//! Observability.
2//!
3//! Emits the per-request causal trace (shapes, ids, field names, never values,
4//! `docs/05`) and assembles the `/debug/explain/{request_id}` document for LLM
5//! consumption. Read-only: it never mutates routing or cluster state
6//! (`docs/decisions/005`).
7//!
8//! The [`RequestTrace`] is **shape-only by construction**, its setters accept
9//! only id newtypes, compile-time labels, and sizes, so there is no API path by
10//! which a tenant value or secret can reach telemetry (`docs/05` ยง7). The
11//! [`ExplainStore`] retains the most recent explanations for the debug endpoint.
12//!
13//! Directive evaluation (runtime verbosity control) lives in `osproxy-control`;
14//! [`resource_spans`] encodes that same shape-only trace as an OTLP/HTTP JSON
15//! payload for export (the wire emission is the I/O layer's job, M7).
16#![deny(missing_docs)]
17
18mod breakglass;
19mod decode;
20mod diagnostic_sink;
21mod directive;
22mod explain;
23mod export;
24mod otlp;
25mod stats;
26mod store;
27mod trace;
28
29pub use breakglass::BreakGlassBuffer;
30pub use decode::decode_directive_set;
31pub use diagnostic_sink::{DiagnosticSink, NoopDiagnosticSink};
32pub use directive::{
33 DiagLevel, DiagnosticsDirective, DirectiveMatch, DirectiveSet, DirectiveVerifier, NoVerifier,
34 RequestAttrs,
35};
36pub use explain::{explain_json, ExplainStore};
37pub use export::{NoopExporter, SpanExporter};
38pub use otlp::resource_spans;
39pub use stats::{Metrics, PoolSnapshot, StatsSnapshot};
40pub use store::{DirectiveStore, InMemoryDirectiveStore};
41pub use trace::{
42 ClassifyInfo, DispatchInfo, EgressInfo, IngressInfo, RequestTrace, ResolveInfo, RewriteInfo,
43};