Log Traces with OpenTelemetry and OpenInference

Learn how to automatically log traces and spans from your agentic frameworks into Deepchecks using OpenTelemetry and OpenInference

Deepchecks now supports logging traces and spans directly via OpenTelemetry and OpenInference.

This means that if you’re using an agentic framework that already provides OpenInference instrumentors (such as CrewAI, LangGraph or others), you can automatically log traces and spans to Deepchecks with minimal setup.

This integration makes it easy to capture rich trace data from your agents and pipelines and centralize them in Deepchecks for evaluation, monitoring and debugging.

Installation

First, install the required dependencies:

pip install opentelemetry-api opentelemetry-sdk
pip install deepchecks-llm-client

Then, install the OpenInference instrumentors for your framework(s). For example, if you’re using CrewAI:

pip install openinference-instrumentation-crewai
pip install openinference-instrumentation-litellm

Usage Example (CrewAI)

Here’s an example of setting up OpenTelemetry tracing with Deepchecks using CrewAI:

from openinference.instrumentation.litellm import LiteLLMInstrumentor
from openinference.instrumentation.crewai import CrewAIInstrumentor
from deepchecks_llm_client.otel import register_dc_exporter

# Register Deepchecks exporter
tracer_provider = register_dc_exporter(
    host="http://localhost:8000",
    api_key="YOUR_API_KEY",
    app_name="YOUR_APP_NAME",
    version_name="YOUR_VERSION NAME",
    env_type="EVAL/PROD",
    log_to_console=True,  # Optional: also log spans to console
)

# Instrument frameworks with OpenInference
CrewAIInstrumentor().instrument(tracer_provider=tracer_provider)
LiteLLMInstrumentor().instrument(tracer_provider=tracer_provider)

How It Works

  • OpenTelemetry standardizes trace collection and handling.
  • OpenInference provides pre-built instrumentors for popular frameworks, so spans are captured automatically.
  • Deepchecks exporter (register_dc_exporter) sends all spans to your Deepchecks workspace.

This allows you to see and evaluate detailed traces and spans, attributes, system metrics and framework events inside the Deepchecks platform, without needing to manually log them.