ModalTrace

ModalTrace

2026 tools

OpenTelemetry observability for real-time AI video pipelines — GPU monitoring, frame-level metrics, and A/V sync tracking.

ModalTrace

OpenTelemetry observability for real-time AI video pipelines. ModalTrace captures traces, metrics, and logs across GPU operations, neural network inference, video rendering, and transport — with frame-level granularity and A/V sync tracking not available in general-purpose APM tools.

Why ModalTrace?

Unlike general-purpose observability tools (Langfuse, Datadog, W&B), ModalTrace is purpose-built for video AI workloads:

  • Video AI metrics — frame rate, inference latency, render time per stage
  • GPU monitoring — utilization, memory, temperature, and power
  • Frame-level metrics — sub-millisecond granularity via ring buffer aggregation
  • A/V sync tracking — drift detection and alerting not available elsewhere
  • Free & open source — Apache 2.0, no per-seat or per-host pricing

Features

  • Automatic span generation per pipeline stage with trace/metrics/log correlation
  • Sub-millisecond frame rate, GPU memory, inference latency, and A/V drift metrics
  • Auto-instrumentation for PyTorch forward/backward passes
  • Adaptive sampling: anomaly-triggered capture for high-latency frames
  • PII scrubbing with regex patterns and custom callbacks
  • OTLP export over HTTP or gRPC to any compatible backend (Jaeger, Datadog, Honeycomb)

Quick Start

pip install modaltrace
# with extras
pip install modaltrace[pytorch,gpu,webrtc,dashboard]
from modaltrace import ModalTraceSDK

sdk = ModalTraceSDK()
sdk.start()

# your pipeline code here

sdk.shutdown()

Configuration via environment variables:

MODALTRACE_SERVICE_NAME=my-video-pipeline
MODALTRACE_OTLP_ENDPOINT=http://localhost:4318
MODALTRACE_PYTORCH_INSTRUMENTATION=true
MODALTRACE_GPU_MONITORING=true

Built-in Dashboard

from modaltrace.dashboard import DashboardServer

server = DashboardServer()
server.start()  # http://localhost:8000

Manual Instrumentation

from modaltrace import get_tracer

tracer = get_tracer(__name__)

with tracer.start_as_current_span("process_frame") as span:
    span.set_attribute("modaltrace.pipeline.frame.sequence_number", frame_id)
    # your code here

Architecture

ModalTrace is structured around four core subsystems:

  • Tracing — adaptive sampling, pending span management, context propagation
  • Metrics — ring buffer aggregation, A/V sync drift detection
  • Instrumentation — PyTorch, GPU, event loop, and transport auto-instrumentation
  • Exporters — OTLP HTTP/gRPC to any OpenTelemetry-compatible backend

Technical Stack

  • Python 3.10+ with PyTorch and CUDA support
  • OpenTelemetry SDK for traces, metrics, and logs
  • Pydantic for configuration validation
  • FastAPI for the built-in dashboard server
  • gRPC / HTTP for OTLP export