chaincodec_observability/lib.rs
1//! # chaincodec-observability
2//!
3//! OpenTelemetry-based observability for ChainCodec.
4//!
5//! ## Built-in metrics
6//! - `chaincodec.events_decoded` — counter, tagged with chain + schema
7//! - `chaincodec.events_skipped` — counter, tagged with chain + reason
8//! - `chaincodec.decode_errors` — counter, tagged with chain + error_type
9//! - `chaincodec.decode_latency_ms` — histogram
10//! - `chaincodec.batch_size` — histogram
11//! - `chaincodec.schema_cache_hits` — counter
12//!
13//! ## Structured logging
14//! JSON-structured logs compatible with ELK, Loki, CloudWatch.
15//! Log levels configurable per component.
16
17pub mod metrics;
18pub mod tracing_setup;
19
20pub use metrics::ChainCodecMetrics;
21pub use tracing_setup::{init_tracing, LogConfig, TracingConfig};