otlp-arrow-library 0.6.4

Cross-platform Rust library for receiving OTLP messages via gRPC and writing to Arrow IPC files
Documentation
//! OTLP Arrow Flight Library
//!
//! A cross-platform Rust library for receiving OpenTelemetry Protocol (OTLP) messages
//! via gRPC and writing them to local files in Arrow IPC Streaming format.
//!
//! # Features
//!
//! - OTLP gRPC reception
//! - Arrow IPC file storage
//! - Public API for embedded usage
//! - Configurable via YAML, environment variables, or programmatic API
//! - Optional remote forwarding
//! - Mock service for testing
//!
//! # Example
//!
//! ```no_run
//! use otlp_arrow_library::{OtlpLibrary, Config};
//!
//! # async fn example() -> Result<(), otlp_arrow_library::OtlpError> {
//! let config = Config::default();
//! let library = OtlpLibrary::new(config).await?;
//!
//! // Export traces
//! // library.export_trace(span).await?;
//! # Ok(())
//! # }
//! ```

#![warn(missing_docs)]
#![warn(clippy::all)]

pub mod api;
pub mod config;
pub mod dashboard;
pub mod error;
pub mod mock;
pub mod otlp;

// Python module - only compiled when python-extension feature is enabled
// This prevents linker errors during cargo test when Python isn't available
#[cfg(feature = "python-extension")]
pub mod python;

// Re-export public API
pub use api::public::OtlpLibrary;
pub use config::{
    AuthConfig, Config, ConfigBuilder, DashboardConfig, ForwardingConfig, ForwardingProtocol,
};
pub use error::{OtlpConfigError, OtlpError, OtlpExportError, OtlpServerError};
pub use mock::service::MockOtlpService;
pub use otlp::OtlpSpanExporter;

// Re-export Python module function for maturin to find
// This makes the #[pymodule] function accessible at crate root level
// Only available when python-extension feature is enabled
#[cfg(feature = "python-extension")]
pub use python::otlp_arrow_library;

// Initialize tracing subscriber for structured logging
use tracing_subscriber::EnvFilter;

/// Initialize structured logging
pub fn init_logging() {
    tracing_subscriber::fmt()
        .with_env_filter(EnvFilter::from_default_env())
        .with_target(false)
        .with_thread_ids(false)
        .with_thread_names(false)
        .init();
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_library_initialization() {
        init_logging();
        // Basic smoke test - just verify logging initializes without panicking
    }
}