Skip to main content

Observability

Instrument your code with OpenTelemetry to capture traces, logs, and metrics for every LLM call, agent step, and tool use.

Observability

Getting Started

Deepset Haystack is a powerful framework for building RAG (Retrieval-Augmented Generation) pipelines and document search systems. Tracing Haystack with Toqan Router provides comprehensive insights into pipeline performance, component interactions, retrieval effectiveness, and answer generation quality to optimize your search and QA applications.

Prerequisites

Before you begin, ensure you have:
  • A Toqan Router account and API Key
  • Haystack 3.x installed in your project (haystack-ai)
  • Python 3.8+
  • API keys for your chosen LLM and embedding providers

Install Dependencies

Configure Toqan Router

Set up your environment variables to connect to Toqan Router’s OpenTelemetry collector: Unix/Linux/macOS:
Windows (PowerShell):
Using .env file:

Integrations

Choose your preferred OpenTelemetry framework for collecting traces, we’ll be using OpenLLMetry (Traceloop).

Examples

Advanced Pipeline with Custom Components

View Traces

To view Traces, head to the Traces tab in the Toqan Router studio.