DSPy
Use the Adaline DSPy integration to send DSPy callback activity into Adaline. The integration registers a DSPy callback handler and observes the predictor or module calls that DSPy emits.Prerequisites
Before you start, make sure you have:- An Adaline account.
- A workspace API key — create one under Settings → API keys.
- Your project ID — copy it from Monitor → Copy Project ID.
Install
Initialize Adaline
Create an Adaline client, then initialize a monitor for the target project.For production guidance — buffering, batching, retries, serverless flushing, and graceful shutdown — see Instrument with the Adaline SDK.
Attach the DSPy callback handler
Create anAdalineDSPyCallbackHandler, then register it through configure_dspy_observability.
configure_dspy_observability can also construct the handler for you if you pass monitor= directly:
Basic example
This example keeps the integration intentionally small: one trivialdspy.Predict call after the Adaline handler has been registered.
Use an existing parent trace or span
The DSPy handler accepts:parent_traceparent_span
What the DSPy integration captures
The DSPy callback handler is designed to capture DSPy execution activity, including:- predictor and module calls
- nested child calls under the active DSPy callback context
- framework, call, and instance metadata stored as Adaline attributes
- child spans under an Adaline parent when provided