llm_shield_cloud_azure/
observability_stub.rs

1//! Stub implementation for Azure observability (monitoring and logging).
2//!
3//! NOTE: This is a temporary stub due to breaking changes in Azure SDK.
4//! Full implementation requires updating to the latest SDK APIs.
5
6use async_trait::async_trait;
7use llm_shield_cloud::error::{CloudError, Result};
8use llm_shield_cloud::observability::{CloudLogger, CloudMetrics, CloudTracer, LogEntry, LogLevel, Metric, Span};
9
10/// Stub implementation for Azure Monitor.
11pub struct AzureMonitor;
12
13impl AzureMonitor {
14    /// Creates a new Azure Monitor client (stub).
15    pub async fn new() -> Result<Self> {
16        Ok(Self)
17    }
18}
19
20#[async_trait]
21impl CloudMetrics for AzureMonitor {
22    async fn export_metrics(&self, _metrics: &[Metric]) -> Result<()> {
23        Err(CloudError::OperationFailed(
24            "Azure Monitor not implemented - SDK API breaking changes".to_string(),
25        ))
26    }
27}
28
29/// Stub implementation for Azure Application Insights.
30pub struct AzureAppInsights;
31
32impl AzureAppInsights {
33    /// Creates a new Azure Application Insights client (stub).
34    pub async fn new(_instrumentation_key: impl Into<String>) -> Result<Self> {
35        Ok(Self)
36    }
37}
38
39#[async_trait]
40impl CloudLogger for AzureAppInsights {
41    async fn log(&self, _message: &str, _level: LogLevel) -> Result<()> {
42        Err(CloudError::OperationFailed(
43            "Azure Application Insights not implemented - SDK API breaking changes".to_string(),
44        ))
45    }
46
47    async fn log_structured(&self, _entry: &LogEntry) -> Result<()> {
48        Err(CloudError::OperationFailed(
49            "Azure Application Insights not implemented - SDK API breaking changes".to_string(),
50        ))
51    }
52}
53
54/// Stub implementation for Azure tracing.
55pub struct AzureTracer;
56
57#[async_trait]
58impl CloudTracer for AzureTracer {
59    async fn end_span(&self, _span: Span) -> Result<()> {
60        Err(CloudError::OperationFailed(
61            "Azure tracing not implemented - SDK API breaking changes".to_string(),
62        ))
63    }
64}