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 trace failing apps for flushing #1138

Open
touhi99 opened this issue Oct 15, 2024 · 0 comments
Open

Langfuse trace failing apps for flushing #1138

touhi99 opened this issue Oct 15, 2024 · 0 comments
Assignees
Labels
bug Something isn't working integration:langfuse P2

Comments

@touhi99
Copy link

touhi99 commented Oct 15, 2024

Describe the bug
Following the documentation here Langfuse, I am adding trace flush on the fastapi

@asynccontextmanager
async def lifespan(app: FastAPI):
    tracer.actual_tracer.flush()

I am getting the following error:

  File "C:\Users\touhidul.alam\Anaconda3\envs\shs\Lib\site-packages\starlette\routing.py", line 732, in lifespan
    async with self.lifespan_context(app) as maybe_state:
  File "C:\Users\touhidul.alam\Anaconda3\envs\shs\Lib\contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\touhidul.alam\Desktop\shs\shs-rag-backend\src\rag\api\api.py", line 17, in lifespan
    tracer.actual_tracer.flush()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NullTracer' object has no attribute 'flush'

ERROR:    Application startup failed. Exiting.

Describe your environment (please complete the following information):

  • OS:Windows
  • Haystack version: 2.6.0
  • Integration version: 0.5.0

it was working with langfuse-haystack==0.2.0 but after upgrading to haystack 0.5.0, it's not working anymore. Any solution idea? Thanks

@touhi99 touhi99 added the bug Something isn't working label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration:langfuse P2
Projects
None yet
Development

No branches or pull requests

4 participants