Skip to main content
LangSmith can capture traces generated by CrewAI using OpenInference’s CrewAI instrumentation. This guide shows you how to automatically capture traces from your CrewAI multi-agent workflows and send them to LangSmith for monitoring and analysis.

Installation

Install the required packages using your preferred package manager:

Setup

1. Configure environment variables

Set your API keys and project name:

2. Configure OpenTelemetry integration

In your CrewAI application, import and configure the LangSmith OpenTelemetry integration along with the CrewAI and OpenAI instrumentors:

3. Create and run your CrewAI application

Once configured, your CrewAI application will automatically send traces to LangSmith: This example includes a minimal app that defines agents and tasks, creates a crew, and runs it to produce traced activity.

Advanced usage

Custom metadata and tags

You can add custom metadata to your traces by setting span attributes in your CrewAI application:

Combining with other instrumentors

You can combine CrewAI instrumentation with other instrumentors by adding them to your setup:

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.