Skip to main content
LangSmith can capture traces generated by Semantic Kernel using its built-in OpenTelemetry support. This guide shows you how to automatically capture traces from your Semantic Kernel applications 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 Semantic Kernel application, configure the LangSmith OpenTelemetry integration along with the OpenAI instrumentor:
You do not need to set any OpenTelemetry environment variables or configure exporters manually—configure() handles everything automatically.

3. Create and run your Semantic Kernel application

Once configured, your Semantic Kernel application 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 Semantic Kernel tracing with other OpenTelemetry instrumentors:

Resources