Product Updates

Monitoring & Tracing DSPy with Langtrace

Karthik Kalyanaraman

Karthik Kalyanaraman

· 3 min read
DSPy x Langtrace


We are excited to announce that Langtrace now supports DSPy, a framework for algorithmically optimizing LM prompts and weights, especially when LMs are used one or more times within a pipeline. This integration expands Langtrace’s capabilities, allowing for automatic tracing of DSPy out of the box allowing the developer to get high cardinal tracing with deeper insights into how DSPy optimizes modules and pipelines.

What is Langtrace?

Langtrace is an open-source observability tool designed to collect and analyze traces to help you improve your LLM (Large Language Model) applications. Langtrace has two main components:

  1. SDK: A lightweight library that can be installed in your project to collect traces. These traces are OpenTelemetry-based and can be exported to Langtrace or any other observability stack.
  2. Langtrace Client: A web-based interface for viewing and analyzing your traces.

Key Benefits of DSPy Support in Langtrace.

  1. Advanced Tracing & Logging: View high cardinal and detailed visual representations of traces and logs extracted from your DSPy modules and sent directly to Langtrace.
  2. Seamless Integration: Enjoy a quick and non intrusive integration with just 2 lines of code.
  3. Open-Source Compatibility: Continue to benefit from open-source tools that prevent vendor lock-in, aligning with Langtrace’s commitment to open-source principles.

Getting Started with Langtrace and DSPy


To begin using DSPy with Langtrace, follow these steps:

  1. Sign Up and Generate an API Key: Sign up for Langtrace and generate an API key from the Langtrace dashboard.
  2. Install the SDK: Install the Langtrace SDK using pip for Python.
  3. Initialize the SDK: Initialize the SDK in your project with the generated API key.
  4. Run Your Application: Start your application and view your traces on the Langtrace dashboard.

For detailed instructions and more information, visit our documentation.


The integration of DSPy support into Langtrace significantly enhances our platform, providing powerful tools for DSPy module tracing and logging. We are eager to see how our community leverages these new capabilities to improve the observability and evaluation of LLM-based applications.

Stay tuned for more updates and features. For any questions or support, please visit our documentation or reach out to our support team.

Happy tracing!

Karthik Kalyanaraman

About Karthik Kalyanaraman

Cofounder and CTO - Langtrace AI, Scale3 Labs