Skip to main content

hyprstream_metrics/
lib.rs

1//! Metrics engine: storage, aggregation, and query execution.
2//!
3//! This crate is the serving/engine half of the metrics substrate
4//! (AGPL-3.0-only): DuckDB and DataFusion backends, the query planner and
5//! orchestrator, metric aggregation execution, and checkpointing. The public
6//! record types, schema, producer API, and the calibration / decision-batch
7//! stores live in the Apache-2.0 `hyprstream-metrics-api` crate; everything
8//! consumers need is re-exported here so existing `hyprstream_metrics::...`
9//! paths keep working.
10
11pub mod checkpoint;
12pub mod config;
13pub mod error;
14pub mod metrics;
15pub mod query;
16pub mod storage;
17pub mod utils;
18
19pub use aggregation::{AggregateFunction, AggregateResult, GroupBy, TimeWindow};
20pub use checkpoint::{
21    Checkpoint, CheckpointConfig, CheckpointManager, CheckpointMetadata, RecoveryManager,
22    RecoveryStatus, RegistryClient, RegistryError,
23};
24pub use hyprstream_metrics_api::aggregation;
25pub use metrics::calibration::{
26    calibration_params_schema, mint_calib_version, CalibrationParams, CalibrationStore,
27    ConformalParams, ConformalQuantile, DecisionPrimitive, DirichletParams, OrdinalInterval,
28    VersionTriple, CALIBRATION_TABLE,
29};
30pub use metrics::decision_batch::{
31    decision_batch_schema, mint_batch_id, DecisionBatchMeta, DecisionBatchStore,
32    DECISION_BATCH_TABLE,
33};
34pub use metrics::producer::MetricsProducer;
35pub use metrics::{create_schema_v2_tables, METRICS_SCHEMA_VERSION, METRICS_TABLE};
36pub use query::{
37    CachedStatement, DataFusionExecutor, DataFusionPlanner, ExecutorConfig, Query,
38    QueryOrchestrator,
39};
40pub use storage::context::{
41    context_schema, ContextRecord, ContextStore, SearchResult, DEFAULT_EMBEDDING_DIM,
42};
43pub use storage::StorageBackend;
44
45// Re-export Arrow types from DuckDB for consistency
46pub use duckdb::arrow;