Skip to main content
LangSmith can capture traces generated by Microsoft Agent Framework using its built-in OpenTelemetry instrumentation. This guide shows you how to automatically capture traces from your Microsoft Agent Framework agents and send them to LangSmith for monitoring and analysis.

Installation

Install the required packages:

Setup

1. Configure environment variables

Enable OpenTelemetry instrumentation of the agent and set the OpenTelemetry environment variables to point to the LangSmith OTEL endpoint:

2. Enable OpenTelemetry in your application

In your Microsoft Agent Framework application, enable OpenTelemetry tracing using the built-in configure_otel_providers function:
Setting enable_sensitive_data=True allows capturing input and output content in traces. Set to False if you want to exclude sensitive data from traces.

3. Create and run your agent

Once configured, your Microsoft Agent Framework agents will automatically send traces to LangSmith: