mirror of
https://github.com/langchain-ai/langsmith-docs.git
synced 2026-08-27 01:41:19 -04:00
DOC: <Issue related to /observability/how_to_guides/tracing/trace_with_opentelemetry> #48
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mindful-time on GitHub (Dec 23, 2024).
Originally assigned to: @angus-langchain on GitHub.
Issue: Unauthorized Access When Integrating Traceloop SDK with LangSmith with LLama-index
Description
When attempting to integrate Traceloop SDK with LangSmith for tracing LlamaIndex operations, receiving consistent 401 Unauthorized errors. The trace export attempts are failing with the following error:
Current Setup
Steps to Reproduce
Expected Behavior
Actual Behavior
Potential Investigation Done
LANGCHAIN_API_KEY)Related Documentation
full implementation
HTTP Request is working
@angus-langchain commented on GitHub (Apr 5, 2025):
Hi @mindful-time, Can you confirm that content encoding is set to
proto. Also, could you confirm that if you create a new API key in the app and re-run this code it still doesn't work?@mindful-time commented on GitHub (Apr 14, 2025):
Hi @angus-langchain sorry was busy, can we make this open. The issue still persists
@angus-langchain commented on GitHub (Apr 14, 2025):
Hi @mindful-time, I'm unable to repro with the code you shared. Are you able to trace to LangSmith normally?
https://smith.langchain.com/public/277dcdd3-c0d1-412e-9cd9-ae7abf4b8262/r
@mindful-time commented on GitHub (Apr 16, 2025):
@angus-langchain do you mean with llama-index or in general with langchain/langgraph ? If it is general with langchain and langgrpah i am , but the llama-index isn't working based on the from traceloop.sdk
@mindful-time commented on GitHub (Apr 16, 2025):
@angus-langchain changed the code to following seemed to work !
`# initialize Traceloop with LangSmith endpoint and authentication environment variables
os.environ["TRACELOOP_BASE_URL"] = "https://api.smith.langchain.com/otel"
os.environ["TRACELOOP_HEADERS"] = "x-api-key=" + langsmith_settings.api_key + ",Langsmith-Project=" + langsmith_settings.project
Traceloop.init()`
Changed code:
updated code repo langsmith-llamaindex
Btw any idea why all the trace aren't coming as one run and three
I think we should use the create_global_handler in llama_index
https://docs.llamaindex.ai/en/stable/module_guides/observability/
Found here :
https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/callbacks/global_handlers.py
PHOENIX_API_KEY = "<PHOENIX_API_KEY>"
os.environ["OTEL_EXPORTER_OTLP_HEADERS"] = f"api_key={PHOENIX_API_KEY}"
llama_index.core.set_global_handler(
"arize_phoenix", endpoint="https://llamatrace.com/v1/traces"
)