Skip to main content

build_langfuse_observer

Function build_langfuse_observer 

Source
pub fn build_langfuse_observer(
    config: Option<&LangfuseConfig>,
    http_stack_config: HttpStackConfig,
) -> Result<Option<LangfuseObserver>>
Expand description

Builds an observer from a typed LangfuseConfig.

Returns Ok(None) when the observer is not enabled (config missing or enabled = false) — the caller should not attach an observer. When enabled = true but public_key / secret_key are missing, a warning is emitted and the observer is disabled (returns Ok(None)). This does not error or silently succeed, matching the explicit validation contract.

§Errors

Returns an error if the HTTP stack fails to build (e.g., TLS roots or proxy URL parsing).