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

Nothing is logged to Langfuse #794

Closed
bilgeyucel opened this issue Jun 7, 2024 · 3 comments
Closed

Nothing is logged to Langfuse #794

bilgeyucel opened this issue Jun 7, 2024 · 3 comments
Assignees
Labels
bug Something isn't working integration:langfuse

Comments

@bilgeyucel
Copy link
Contributor

Describe the bug
I see the trace is saved but I dont see the details of my pipeline in Langfuse. Everything seems null
image
Langfuse trace for further debugging: https://us.cloud.langfuse.com/project/clx4rzcjx00091n5vppw1l8rh/traces/f9a6f5c0-55cd-472e-92f3-10bec49ad025?observation=27cbc891-f9d0-4f8c-96df-2f7d4d30edd8

To Reproduce
Colab notebook: https://colab.research.google.com/drive/1j6H88t8WaMNhA4y0qWCS1wqZhBW3TEFU?usp=sharing

Describe your environment (please complete the following information):

  • OS: Google Colab
  • Haystack version: 2.2.0
  • Integration version: langfuse_haystack-0.0.4
@bilgeyucel bilgeyucel added bug Something isn't working integration:langfuse labels Jun 7, 2024
@mrm1001
Copy link

mrm1001 commented Jun 13, 2024

Managed to reproduce issue in local notebook.

@Redna
Copy link
Contributor

Redna commented Jun 14, 2024

seems to be the same as in #789 then environment vars needs to be set before the actual import of LangfuseConnector.

from datasets import load_dataset
from haystack import Document, Pipeline
from haystack.components.builders import PromptBuilder
from haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder
from haystack.components.generators import OpenAIGenerator
from haystack.components.retrievers import InMemoryEmbeddingRetriever
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_integrations.components.connectors.langfuse import LangfuseConnector
import os
from google.colab import userdata

os.environ["OPENAI_API_KEY"] = userdata.get('OPENAI_API_KEY')
os.environ["TOKENIZERS_PARALLELISM"] = "false"
os.environ["HAYSTACK_CONTENT_TRACING_ENABLED"]="True"
os.environ["LANGFUSE_SECRET_KEY"]=userdata.get('LANGFUSE_SECRET_KEY')
os.environ["LANGFUSE_PUBLIC_KEY"]=userdata.get('LANGFUSE_PUBLIC_KEY')
os.environ["LANGFUSE_HOST"]="https://us.cloud.langfuse.com"

needs to be changed to

from datasets import load_dataset
from haystack import Document, Pipeline
from haystack.components.builders import PromptBuilder

import os
os.environ["OPENAI_API_KEY"] = userdata.get('OPENAI_API_KEY')
os.environ["TOKENIZERS_PARALLELISM"] = "false"
os.environ["HAYSTACK_CONTENT_TRACING_ENABLED"]="True"
os.environ["LANGFUSE_SECRET_KEY"]=userdata.get('LANGFUSE_SECRET_KEY')
os.environ["LANGFUSE_PUBLIC_KEY"]=userdata.get('LANGFUSE_PUBLIC_KEY')
os.environ["LANGFUSE_HOST"]="https://us.cloud.langfuse.com"

from haystack.components.embedders import OpenAIDocumentEmbedder, OpenAITextEmbedder
from haystack.components.generators import OpenAIGenerator
from haystack.components.retrievers import InMemoryEmbeddingRetriever
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_integrations.components.connectors.langfuse import LangfuseConnector

from google.colab import userdata



@masci
Copy link
Contributor

masci commented Jun 14, 2024

Thanks @Redna, that's the problem indeed. I filed a change to the docs to stress that the environment variable must be set before importing the tracer, we can close.

@masci masci closed this as completed Jun 14, 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
Projects
None yet
Development

No branches or pull requests

4 participants