Skip to main content
This quickstart shows how to instrument your LangChain application using OpenLLMetry and Scorecard for observability, debugging, and evaluation.
Looking for general tracing guidance? Check out the Tracing Quickstart for an overview of tracing concepts and alternative integration methods.

Steps

1

Install dependencies

Install the Traceloop SDK and the LangChain instrumentation package.
2

Set up environment variables

Configure the Traceloop SDK to send traces to Scorecard. Get your Scorecard API key from Settings.
Replace <your_scorecard_api_key> with your actual Scorecard API key (starts with ak_).
3

Initialize tracing

Initialize the Traceloop SDK with LangChain instrumentation before importing LangChain modules.
Import order matters! You must initialize Traceloop before importing any LangChain modules to ensure all calls are properly instrumented.
4

Run your LangChain application

With tracing initialized, run your LangChain application. All LLM calls, chain executions, and agent actions are automatically traced.Here’s a full example:
example.py
You may see Failed to export batch warnings in the console. These can be safely ignored - your traces are still being captured and sent to Scorecard successfully.
5

View traces in Scorecard

Navigate to the Records page in Scorecard to see your LangChain traces.
It may take 1-2 minutes for traces to appear on the Records page.
Records page showing LangChain tracesRecords page showing LangChain traces

Records page showing LangChain application traces

Click on any record to view the full trace details, including chain execution, LLM calls, and token usage.
Trace details viewTrace details view

Trace details with chain execution and LLM call data

What Gets Traced

OpenLLMetry automatically captures comprehensive telemetry from your LangChain applications:

Next Steps

Records

Learn more about viewing and managing your traced records

Metrics

Create custom metrics to evaluate LangChain application performance