In an agent-based workspace, create an agent once before sending traces. Use agent addressing to select its identifier and environment. If an integration requires
project_name, use the selected environment’s tracer_session_name as a compatibility value.Installation
Install the required packages using your preferred package manager:Setup
1. Configure environment variables
Sending traces to an agent requireslangsmith>=0.14.9.
Set your API keys, agent identifier, and environment:
2. Configure OpenTelemetry integration
In your CrewAI agent, configure the LangSmith OpenTelemetry integration along with the CrewAI and OpenAI instrumentors:3. Create and run your CrewAI agent
Once configured, your CrewAI agent will automatically send traces to LangSmith:Advanced usage
Custom metadata and tags
You can add custom metadata to your traces by setting span attributes:Combining with other instrumentors
You can combine CrewAI instrumentation with other OpenTelemetry instrumentors:Resources
Connect these docs to your agent of choice via MCP for real-time answers.

