Skip to main content

Overview

Valiqor tracing captures the full execution flow of your AI application — LLM calls, tool executions, retrieval steps, and custom logic — as structured traces with spans. Three levels of instrumentation are available:
  1. Zero-configimport valiqor.auto and traces are captured automatically
  2. Decorators@trace_workflow and @trace_function for explicit control
  3. Manual spans — Full control via TracerV2 for complex pipelines

Zero-Config Auto-Instrumentation

The simplest way to start tracing. Add one import at the top of your application:
This reads your configuration from environment variables or .valiqorrc and automatically patches supported providers (OpenAI, Anthropic, LangChain, Ollama, Agno).

autolog() Function

Enable auto-instrumentation programmatically with more control:

disable_autolog()

Disable auto-instrumentation:

Provider-Specific Shortcuts


configure() Function

Configure the tracing system programmatically:

Decorators

@trace_workflow

Create a trace for a workflow. Works as both a context manager and a decorator.

@trace_function

Create a span under the active trace for a function call.

Conversation Tracking

For multi-turn conversational agents, group multiple interactions into a single trace:

TracerV2 — Manual Tracing

For full control over trace and span lifecycle:

Constructor

Trace Lifecycle

Span Lifecycle

Message Logging


RAG-Specific Methods

TracerV2 provides specialized methods for tracing RAG pipelines:

track_retrieval()

Track a retrieval step with document hits.

track_generation()

Track a generation step.

track_rag_pipeline()

Track the entire RAG pipeline in one call.

Constants

ValiqorStage

Pipeline stage labels for spans:

ValiqorSpanKind

Span kind classification:

Exporters

ConsoleExporter

Print trace events to the console. Useful for development.

FileExporter

Write trace events to local JSON files.

APIExporter

Upload trace events to the Valiqor backend.