diff --git a/src/docs.json b/src/docs.json index 96473b4ff1..7679765cc6 100644 --- a/src/docs.json +++ b/src/docs.json @@ -895,7 +895,6 @@ "langsmith/trace-openai", "langsmith/trace-with-autogen", "langsmith/trace-claude-agent-sdk", - "langsmith/trace-claude-code", "langsmith/trace-with-crewai", "langsmith/trace-with-google-adk", "langsmith/trace-with-instructor", diff --git a/src/langsmith/trace-claude-code.mdx b/src/langsmith/trace-claude-code.mdx deleted file mode 100644 index 48694c7599..0000000000 --- a/src/langsmith/trace-claude-code.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Trace Claude Code -sidebarTitle: Claude Code ---- - -[Claude Code](https://code.claude.com/docs/en/overview) is one of the most impressive and useful AI coding tools to date. Claude code emits events for monitoring and observability. LangSmith can collect and display these events to give you a full detailed log on what Claude Code does under the hood. - -## Quick Start - -You can integrate LangSmith tracing with Claude Code by setting the following environment variables in the environment in which you run Claude Code. - -```bash -# Enables Claude Code to emit OTEL events -export CLAUDE_CODE_ENABLE_TELEMETRY=1 - -# Sets the output format to use Open Telemetry Protocol -export OTEL_LOGS_EXPORTER=otlp - -# LangSmith ingests JSON format events -export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/json - -# Claude Code Logs are translated to Spans by LangSmith -export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://api.smith.langchain.com/otel/v1/claude_code - -# Pass your API key and desired tracing project through headers -export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=,Langsmith-Project=" - -# Set this to true in order to log the input user prompts -export OTEL_LOG_USER_PROMPTS=1 - -# Once these are set, start Claude Code, and events will be traced to LangSmith -claude -``` - - -Claude Code emits [open telemetry standard events](https://code.claude.com/docs/en/monitoring-usage#events) for monitoring usage, but this does not include the actual prompts and messages that go to the LLM. - - - -If you're self-hosting LangSmith, replace the base endpoint with your LangSmith api endpoint and append `/api/v1`. For example: `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://ai-company.com/api/v1/otel/v1/claude_code` - - -![Claude Code Trace](/langsmith/images/claude-code-trace.png) diff --git a/src/langsmith/trace-with-livekit.mdx b/src/langsmith/trace-with-livekit.mdx index 8bfab812b4..a5f0f516dc 100644 --- a/src/langsmith/trace-with-livekit.mdx +++ b/src/langsmith/trace-with-livekit.mdx @@ -154,7 +154,9 @@ Run your voice agent in console mode for local testing: python agent.py console ``` -Your agent will start and connect to LiveKit. Speak through your microphone, and all conversation traces will automatically appear in LangSmith. View the complete [agent.py code](https://github.com/langchain-ai/voice-agents-tracing/blob/main/livekit/agent.py). +Your agent will start and connect to LiveKit. Speak through your microphone, and all traces will automatically appear in LangSmith. Here is an example of a trace in LangSmith: [LangSmith trace with LiveKit](https://smith.langchain.com/public/0f583c03-6d2a-4a2c-a043-9588e387cb55/r) + +View the complete [agent.py code](https://github.com/langchain-ai/voice-agents-tracing/blob/main/livekit/agent.py). ## Advanced usage diff --git a/src/langsmith/trace-with-pipecat.mdx b/src/langsmith/trace-with-pipecat.mdx index 0eaaefdb83..cc9c9516f1 100644 --- a/src/langsmith/trace-with-pipecat.mdx +++ b/src/langsmith/trace-with-pipecat.mdx @@ -160,7 +160,9 @@ Run your voice agent: python agent.py ``` -Speak to the agent through your microphone. All conversation traces will automatically appear in LangSmith. View the complete [agent.py code](https://github.com/langchain-ai/voice-agents-tracing/blob/main/pipecat/agent.py). +Speak to the agent through your microphone. All traces will automatically appear in LangSmith. Here is an example of a trace in LangSmith: [LangSmith trace with Pipecat](https://smith.langchain.com/public/07721f41-cd27-413e-bc79-90bd23b6807d/r). + +View the complete [agent.py code](https://github.com/langchain-ai/voice-agents-tracing/blob/main/pipecat/agent.py). ## Advanced usage @@ -298,7 +300,7 @@ finally: If traces aren't showing up in LangSmith: -1. **Verify environment variables**: Ensure `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_HEADERS` are set correctly in your `.env` file +1. **Verify environment variables**: Ensure `OTEL_EXPORTER_OTLP_ENDPOINT` and `OTEL_EXPORTER_OTLP_HEADERS` are set correctly in your `.env` file. 2. **Check API key**: Confirm your LangSmith API key has write permissions. 3. **Verify import**: Make sure you're importing `span_processor` from `langsmith_processor.py`. 4. **Check .env loading**: Ensure `load_dotenv()` is called before importing Pipecat components.