magicapi-ai-gateway 1.0.0

[DEPRECATED] This package has been renamed to 'noveum-ai-gateway'. Please use the new package for all future development. A high-performance AI Gateway proxy for routing requests to various AI providers, offering seamless integration and management of multiple AI providers.
use super::RequestMetrics;
use async_trait::async_trait;
use std::error::Error;

#[async_trait]
pub trait TelemetryPlugin: Send + Sync {
    async fn export(&self, metrics: &RequestMetrics) -> Result<(), Box<dyn Error>>;
    fn name(&self) -> &str;
}

// Example plugin stubs (to be implemented later)
pub mod elasticsearch;
pub mod console;

pub use console::ConsolePlugin;

#[async_trait]
impl TelemetryPlugin for ConsolePlugin {
    async fn export(&self, metrics: &RequestMetrics) -> Result<(), Box<dyn Error>> {
        println!("Request Metrics:\n{:#?}", metrics);
        Ok(())
    }

    fn name(&self) -> &str {
        "console"
    }
}