Skip to main content

athena_observability/
lib.rs

1//! Portable Athena observability primitives.
2//!
3//! This crate owns the reusable observability domain that can be shared across
4//! the Athena server runtime, future adapters, and helper binaries without
5//! depending on Actix, `AppState`, or route-local database registries.
6//!
7//! The current scope covers:
8//!
9//! - in-memory metrics state and classification helpers,
10//! - batched client statistics writes,
11//! - optional Linux NDJSON log sinks for gateway traffic,
12//! - reusable gateway log contracts, redaction helpers, and trace emitters.
13
14pub mod client_stats;
15pub mod gateway_logging;
16pub mod linux_gateway_file_log;
17pub mod metrics;
18
19pub use client_stats::{ClientStatsBatcher, ClientStatsBatcherConfig};
20pub use gateway_logging::{
21    LoggedRequest, RequestAuthLogContext, RequestCompletionLogContext, RouteRequestLogContext,
22    emit_gateway_operation_trace, is_sensitive_field_name, redact_json_value,
23    redact_optional_secret, redact_query_string,
24};
25pub use linux_gateway_file_log::{
26    API_KEY_AUTH_LOG_FILENAME, GATEWAY_OPERATION_LOG_FILENAME, GATEWAY_REQUEST_LOG_FILENAME,
27    LinuxGatewayFileLog,
28};
29pub use metrics::{
30    ClusterProbeMetric, DURATION_BUCKETS_SECONDS, DurationSummary, GatewayOperationMetric,
31    HttpMetric, HttpRouteMetric, ManagementMetric, MetricsState, ValueSummary, gateway_error_class,
32    route_group, status_family,
33};