Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Langfuse makes haystack slow #1315

Open
mydsoElliott opened this issue Jan 22, 2025 · 3 comments
Open

Langfuse makes haystack slow #1315

mydsoElliott opened this issue Jan 22, 2025 · 3 comments

Comments

@mydsoElliott
Copy link

mydsoElliott commented Jan 22, 2025

Describe the bug
Langfuse make haystack slow : for a 13 second pipeline, it takes extra 6 seconds when running with langfuse tracer for a total of 19s.
After profiling my pipeline, it looks like uploading to langfuse take time, as if it was waiting for it to be uploaded to run the next component.

I'm using langfuse self hosted

Describe your environment (please complete the following information):

  • OS: ubuntu (docker)
  • Haystack version: 2.9
  • Integration version: 0.7
@mydsoElliott mydsoElliott added the bug Something isn't working label Jan 22, 2025
@mydsoElliott mydsoElliott changed the title Langfuse make haystack slow Langfuse makes haystack slow Jan 23, 2025
@mydsoElliott
Copy link
Author

mydsoElliott commented Jan 23, 2025

After more research, I found that setting HAYSTACK_LANGFUSE_ENFORCE_FLUSH to false solve the problem.
It would be nice to either have a parameter to change it, or even documentations for it.

@julian-risch
Copy link
Member

Hello @mydsoElliott thanks for reaching out. Just to better understand how we could improve documentation: Have you found the documentation page about Haystack's langfuse integration? https://docs.haystack.deepset.ai/reference/integrations-langfuse
We describe the HAYSTACK_LANGFUSE_ENFORCE_FLUSH there and in the component docstring here including the motivation for the default setting true. So this issue is mainly about making this setting more visible to users and explicitly mentioning the effect on speed?

@julian-risch julian-risch added P3 and removed bug Something isn't working labels Jan 23, 2025
@mydsoElliott
Copy link
Author

mydsoElliott commented Jan 23, 2025

Hello, indeed I never found this by myself, so It's a bit my bad. But even if I did, I don't think I would have known that it was making the pipeline that much slower.

May be a better way would be to mention it in the langfuse connector.
https://docs.haystack.deepset.ai/docs/langfuseconnector

as I feel like it's something you're more likely to see.

Mentionning speed could also be nice.

Also having it on by default without a warning nor being in debug mode can make it hard to realize it if you don't specifically look for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants