Skip to main content
This guide shows how to trace pipelines that handle multi-modal data - images, audio, video, or documents with embedded media.
Auto-instrumentation captures vision calls automatically. If you’re using OpenAI Vision, Gemini Pro Vision, or similar APIs, the LLM calls are traced automatically via instrumentors. This guide covers tracing your custom processing logic around those calls.

When to Use This Guide

Use these patterns when your pipeline includes:
  • Image preprocessing before vision model calls
  • Audio transcription or synthesis
  • Video frame extraction or analysis
  • Document parsing with embedded media
  • Media storage/retrieval operations

Basic Pattern

Trace multi-modal functions the same way as any other function - use the @trace decorator:

Adding Media Metadata

Add context about the media being processed using enrich_span:
Don’t log media bytes. Store references (paths, URLs, IDs) instead of raw binary data. This keeps traces lightweight and queryable.

Multi-Step Pipeline Example

For pipelines with multiple processing stages, each traced function becomes a child span:
The trace tree shows the full pipeline hierarchy:

Useful Metadata Fields


Custom Spans

Full guide to the @trace decorator

Enriching Traces

Adding metadata with enrich_span

OpenAI Vision

Auto-tracing for OpenAI vision calls

Gemini Vision

Auto-tracing for Gemini vision calls