log_tracing_layer/log_ingestor.rs
1use async_trait::async_trait;
2use chrono::{DateTime, Utc};
3use serde_json::{Map, Value};
4
5pub type Log = Map<String, Value>;
6
7#[derive(Debug)]
8pub struct LogEvent {
9 pub log: Log,
10 pub received_at: DateTime<Utc>,
11}
12
13#[async_trait]
14pub trait LogIngestor: Send + Sync {
15 fn name(&self) -> &'static str;
16 fn start(&self);
17 async fn ingest(&mut self, log: Log);
18 async fn flush(&mut self);
19}