Skip to main content

llm_sentinel_ingestion/
lib.rs

1//! # Sentinel Ingestion
2//!
3//! Telemetry ingestion service for LLM-Sentinel.
4//!
5//! This crate provides:
6//! - Kafka consumer for high-throughput event streaming
7//! - OpenTelemetry Protocol (OTLP) parsing
8//! - Event validation and normalization
9//! - Buffering and batching for efficient processing
10
11#![warn(missing_debug_implementations, rust_2018_idioms, unreachable_pub)]
12
13pub mod kafka;
14pub mod otlp;
15pub mod pipeline;
16pub mod validation;
17
18use async_trait::async_trait;
19use llm_sentinel_core::{events::TelemetryEvent, Result};
20
21/// Trait for telemetry ingesters
22#[async_trait]
23pub trait Ingester: Send + Sync {
24    /// Start the ingester
25    async fn start(&mut self) -> Result<()>;
26
27    /// Stop the ingester gracefully
28    async fn stop(&mut self) -> Result<()>;
29
30    /// Get the next batch of telemetry events
31    async fn next_batch(&mut self) -> Result<Vec<TelemetryEvent>>;
32
33    /// Check if ingester is healthy
34    async fn health_check(&self) -> Result<()>;
35}
36
37/// Re-export commonly used types
38pub mod prelude {
39    pub use crate::kafka::KafkaIngester;
40    pub use crate::otlp::OtlpParser;
41    pub use crate::pipeline::{IngestionPipeline, PipelineConfig};
42    pub use crate::validation::EventValidator;
43    pub use crate::Ingester;
44}