Skip to content

ILangfuseSession

NexusLabs.Foundry.Langfuse

ILangfuseSession Interface

Represents a standalone Langfuse export owner. Extends the non-owning ILangfuseClient facade with explicit flush, shutdown, and disposal lifecycle.

public interface ILangfuseSession : NexusLabs.Foundry.Langfuse.ILangfuseClient, System.IDisposable

Implements ILangfuseClient, System.IDisposable

Remarks

Obtain an instance from Start(LangfuseOptions). Keep it alive for the lifetime over which agent runs and evaluations should be captured, then dispose it to perform a bounded, best-effort final drain.

Methods

ILangfuseSession.Flush(Nullable<TimeSpan>) Method

Flushes buffered telemetry to Langfuse.

bool Flush(System.Nullable<System.TimeSpan> timeout=null);

Parameters

timeout System.Nullable<System.TimeSpan>

Maximum time to wait, or System.Threading.Timeout.InfiniteTimeSpan to wait indefinitely. A provider default is used when null.

Returns

System.Boolean
true if the flush succeeded; otherwise false.

ILangfuseSession.Shutdown(TimeSpan) Method

Performs final local OpenTelemetry provider shutdown and releases all resources owned by the session.

NexusLabs.Foundry.Langfuse.LangfuseShutdownOutcome Shutdown(System.TimeSpan timeout);

Parameters

timeout System.TimeSpan

The total timeout budget shared by trace and metric provider shutdown, or System.Threading.Timeout.InfiniteTimeSpan to explicitly wait indefinitely.

Returns

LangfuseShutdownOutcome
An outcome describing whether local trace and metric provider shutdown completed.

Exceptions

System.ArgumentOutOfRangeException
timeout is negative and is not System.Threading.Timeout.InfiniteTimeSpan.

Remarks

Exactly one caller performs final shutdown. Concurrent callers return a non-final outcome, and calls made after completion return the cached final outcome.