pub struct Config {
pub output_dir: PathBuf,
pub write_interval_secs: u64,
pub trace_cleanup_interval_secs: u64,
pub metric_cleanup_interval_secs: u64,
pub max_trace_buffer_size: usize,
pub max_metric_buffer_size: usize,
pub protocols: ProtocolConfig,
pub forwarding: Option<ForwardingConfig>,
pub dashboard: DashboardConfig,
pub metric_temporality: Option<Temporality>,
}Expand description
Main configuration structure for the OTLP Arrow Library
This structure contains all configuration options for the library, including output directory, write intervals, cleanup schedules, protocol settings, optional remote forwarding, and dashboard HTTP server.
§Configuration Sources
Configuration can be loaded from:
- YAML files
- Environment variables (with
OTLP_*prefix) - Programmatic API (using
ConfigBuilder)
§Default Values
output_dir:./output_dirwrite_interval_secs:5trace_cleanup_interval_secs:600(10 minutes)metric_cleanup_interval_secs:3600(1 hour)protocols: Both Protobuf and Arrow Flight enabled by defaultforwarding: Disabled by defaultdashboard: Disabled by default
§Example
use otlp_arrow_library::Config;
// Use defaults
let config = Config::default();
// Or use builder
let config = otlp_arrow_library::ConfigBuilder::new()
.output_dir("./custom_output")
.write_interval_secs(10)
.build()?;Fields§
§output_dir: PathBufOutput directory for Arrow IPC files (default: ./output_dir)
write_interval_secs: u64How frequently to write batches to disk in seconds (default: 5)
trace_cleanup_interval_secs: u64How frequently to clean old trace files in seconds (default: 600)
metric_cleanup_interval_secs: u64How frequently to clean old metric files in seconds (default: 3600)
max_trace_buffer_size: usizeMaximum number of trace spans to buffer in memory (default: 10000)
max_metric_buffer_size: usizeMaximum number of metric requests to buffer in memory (default: 10000)
protocols: ProtocolConfigProtocol configuration (Protobuf and Arrow Flight)
forwarding: Option<ForwardingConfig>Optional remote forwarding configuration
dashboard: DashboardConfigDashboard HTTP server configuration
metric_temporality: Option<Temporality>Temporality mode for metric exporters (default: Cumulative)
This setting controls how metrics are aggregated:
- Cumulative: Metrics accumulate values over time (default, backward compatible)
- Delta: Metrics represent changes since last export
Note: Temporality is not serializable, so this field is skipped during serialization. It can only be set programmatically via ConfigBuilder.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request