pub struct LangfuseConfigBuilder { /* private fields */ }Expand description
Builder for LangfuseConfig.
Implementations§
Source§impl LangfuseConfigBuilder
impl LangfuseConfigBuilder
Sourcepub fn public_key(self, key: impl Into<String>) -> Self
pub fn public_key(self, key: impl Into<String>) -> Self
Set the Langfuse public key (required).
Sourcepub fn secret_key(self, key: impl Into<String>) -> Self
pub fn secret_key(self, key: impl Into<String>) -> Self
Set the Langfuse secret key (required).
Sourcepub fn flush_at(self, count: usize) -> Self
pub fn flush_at(self, count: usize) -> Self
Set the number of events to buffer before flushing.
Sourcepub fn flush_interval(self, interval: Duration) -> Self
pub fn flush_interval(self, interval: Duration) -> Self
Set the maximum interval between flushes.
Sourcepub fn sample_rate(self, rate: f64) -> Self
pub fn sample_rate(self, rate: f64) -> Self
Set the sampling rate (0.0–1.0).
Sourcepub fn environment(self, env: impl Into<String>) -> Self
pub fn environment(self, env: impl Into<String>) -> Self
Set the environment tag.
Sourcepub fn tracing_enabled(self, enabled: bool) -> Self
pub fn tracing_enabled(self, enabled: bool) -> Self
Enable or disable tracing.
Sourcepub fn mask(self, f: impl Fn(Value) -> Value + Send + Sync + 'static) -> Self
pub fn mask(self, f: impl Fn(Value) -> Value + Send + Sync + 'static) -> Self
Set a mask function to transform JSON values before storing as span attributes.
Sourcepub fn additional_headers(self, headers: HashMap<String, String>) -> Self
pub fn additional_headers(self, headers: HashMap<String, String>) -> Self
Set additional HTTP headers to include in all requests.
Sourcepub fn max_retries(self, retries: usize) -> Self
pub fn max_retries(self, retries: usize) -> Self
Set the maximum number of retries for HTTP requests.
Sourcepub fn media_upload_thread_count(self, count: usize) -> Self
pub fn media_upload_thread_count(self, count: usize) -> Self
Set the number of threads for media uploads.
Sourcepub fn io_capture_enabled(self, enabled: bool) -> Self
pub fn io_capture_enabled(self, enabled: bool) -> Self
Enable or disable I/O capture for the observe decorator.
Sourcepub fn should_export_span(
self,
f: impl Fn(&SpanData) -> bool + Send + Sync + 'static,
) -> Self
pub fn should_export_span( self, f: impl Fn(&SpanData) -> bool + Send + Sync + 'static, ) -> Self
Set a filter function to decide whether a span should be exported.
Sourcepub fn build(self) -> Result<LangfuseConfig, ConfigError>
pub fn build(self) -> Result<LangfuseConfig, ConfigError>
Build the configuration, returning an error if required fields are missing.
Trait Implementations§
Source§impl Default for LangfuseConfigBuilder
impl Default for LangfuseConfigBuilder
Source§fn default() -> LangfuseConfigBuilder
fn default() -> LangfuseConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LangfuseConfigBuilder
impl !RefUnwindSafe for LangfuseConfigBuilder
impl Send for LangfuseConfigBuilder
impl Sync for LangfuseConfigBuilder
impl Unpin for LangfuseConfigBuilder
impl UnsafeUnpin for LangfuseConfigBuilder
impl !UnwindSafe for LangfuseConfigBuilder
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
Mutably borrows from an owned value. Read more