skillfed

openinference-instrumentation-dspy

OpenInference DSPy Instrumentation

openinference-instrumentation-dspy v0.1.39 207.4K downloads/30d#9,553 on PyPI1,147
Permissive license Apache-2.0 Active released

What it is and what it does

This package wraps DSPy applications with OpenTelemetry instrumentation, automatically capturing execution traces without requiring code changes to your DSPy modules. It integrates with the OpenInference standard, making traces compatible with observability platforms like Arize Phoenix and Arize AX for visualization and debugging.

The instrumentation works by hooking into DSPy's execution flow and emitting spans that describe each step of your program's reasoning and module calls. You configure it once with a tracer provider and exporter, then call `DSPyInstrumentor().instrument()` to enable tracing for all DSPy code in your application. Traces are sent to your chosen collector endpoint, where you can inspect them in a web UI to understand what your DSPy program is doing, debug failures, and optimize performance.

Use it for:

  • Debug DSPy program behavior by viewing step-by-step execution traces in Arize Phoenix or Arize AX.
  • Monitor DSPy application performance and identify bottlenecks in module execution and LM calls.
  • Track DSPy program optimization results by comparing traces before and after teleprompter compilation.
  • Audit DSPy reasoning chains to understand how your program arrived at specific answers.
  • Integrate DSPy tracing into a broader observability stack using standard OpenTelemetry exporters.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Auto-instruments DSPy applications to generate OpenTelemetry-compatible traces for observability and debugging, sending them to collectors like Arize Phoenix or Arize AX.

Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and provides essential observability for DSPy applications. If you are developing or debugging DSPy programs, this instrumentation is straightforward to add and immediately useful for understanding execution flow. The Apache-2.0 license poses no restriction.

Install

openinference-instrumentation-dspy on PyPI

pip

pip install openinference-instrumentation-dspy

uv

uv add openinference-instrumentation-dspy

poetry

poetry add openinference-instrumentation-dspy

Installing openinference-instrumentation-dspy

Before you install

Low install friction with a pure Python wheel. The package is actively maintained (last commit 2026-08-14, release 7 days old) and depends on well-established OpenTelemetry and OpenInference libraries, all of which are standard instrumentation infrastructure.

License in practice

Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restriction.

Quickstart

pip install openinference-instrumentation-dspy

from openinference.instrumentation.dspy import DSPyInstrumentor
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry import trace as trace_api
from opentelemetry.sdk import trace as trace_sdk

tracer_provider = trace_sdk.TracerProvider()
trace_api.set_tracer_provider(tracer_provider)
tracer_provider.add_span_processor(SimpleSpanProcessor(OTLPSpanExporter("http://127.0.0.1:6006/v1/traces")))
DSPyInstrumentor().instrument()

Requires Python 3.10 or later; requires a running OpenTelemetry collector endpoint (e.g., Arize Phoenix) to receive and visualize traces.

Verify before relying

  • Whether the package supports tracing of all DSPy module types or only specific ones like ChainOfThought.
  • Performance overhead of instrumentation on DSPy execution time and memory usage.
  • Whether custom span attributes and session tracking work with all OpenTelemetry exporters or only specific ones.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, typing-extensions, wrapt
Maintenance actively maintained — 7 days since the last release
Last repo commit
First released
Downloads 207,382/month — #9,553 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: openinference_instrumentation_dspy-0.1.39-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

dspy tracing instrumentationopentelemetry dspydspy observabilitydspy application tracesdspy debugging monitoringopeninference dspydspy span collection
observabilitydspyopentelemetry

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

openinference-instrumentation-google-genai

Automatically instruments Google GenAI SDK…

permissive · top 15,000 on PyPI

openinference-instrumentation-agno

Auto-instruments Agno Agent applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-llama-index

Auto-instruments LlamaIndex applications to…

permissive · top 15,000 on PyPI

openinference-instrumentation-haystack

Auto-instruments Haystack LLM pipelines and…

permissive · top 15,000 on PyPI

openinference-instrumentation-anthropic

Automatically captures and exports traces from…

permissive · top 15,000 on PyPI

openinference-instrumentation-pydantic-ai

Auto-instruments PydanticAI agents to emit…

permissive · top 15,000 on PyPI

openinference-instrumentation-openai

Auto-instruments OpenAI Python SDK calls to…

permissive · top 5,000 on PyPI

openinference-instrumentation-mcp

Auto-instruments MCP tool calls to propagate…

permissive · top 15,000 on PyPI

openinference-instrumentation-google-adk

Auto-instruments Google ADK applications to…

permissive · top 15,000 on PyPI

libhoney

Sends events and metrics to Honeycomb, a…

permissive · top 15,000 on PyPI