You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently the Langfuse integration is very slow when content tracing is enabled, even for a local Langfuse deployment.
The problem is that the trace method defined in haystack_integrations.tracing.langfuse.LangfuseTracer is calling the flushmethod of the tracer. This blocks the entire Thread until the data has been pushed. As it is executed before and after each component this slows down the execution dramatically.
From my experience adding Langfuse causes a slow down of around 3 to 5 times the normal execution time.
Describe the solution you'd like
move the flush method to a separate Tread:
threading.Thread(target=self._tracer.flush, daemon=True)
Describe alternatives you've considered
make "force_flush" optional to enable this feature for short living applications (Lambda functions) and leave open to the developer to flush the data before application shutdown.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently the Langfuse integration is very slow when content tracing is enabled, even for a local Langfuse deployment.
The problem is that the
trace
method defined inhaystack_integrations.tracing.langfuse.LangfuseTracer
is calling theflush
method of the tracer. This blocks the entire Thread until the data has been pushed. As it is executed before and after each component this slows down the execution dramatically.From my experience adding Langfuse causes a slow down of around 3 to 5 times the normal execution time.
Describe the solution you'd like
threading.Thread(target=self._tracer.flush, daemon=True)
Describe alternatives you've considered
make "force_flush" optional to enable this feature for short living applications (Lambda functions) and leave open to the developer to flush the data before application shutdown.
The text was updated successfully, but these errors were encountered: