Spanlens
Monitor and trace LLM requests across providers like OpenAI, Anthropic, and Gemini. Track costs, latency, and agent workflows with self-hosted, MIT-licensed software.

Spanlens provides open-source observability and monitoring for Large Language Model (LLM) applications. It enables developers to log, trace, and analyze every model call, agent interaction, and tool execution across multiple providers including OpenAI, Anthropic, and Gemini.
Key Features
- Request Logging & Cost Tracking: Monitor spend, tokens, and cache savings per model and project with real-time pricing updates.
- Agent Tracing: Visualize nested spans across tools, retrievals, and model calls to identify performance bottlenecks.
- Prompt Versioning: Pin and compare prompt versions to assess cost, latency, and quality changes over time.
- Caching & Evals: Implement exact-match caching to reduce costs and run automated evaluations in CI pipelines.
- Multi-Provider Support: Compatible with OpenAI, Anthropic, Gemini, Groq, Mistral, XAI, OpenRouter, and more.
- PII Detection: Automatically mask sensitive data (SSN, credit cards, API keys) without blocking requests.
- OpenTelemetry Integration: Seamlessly integrate with existing OTel tracing workflows.
- Self-Hosting: Deploy via Docker for unlimited requests, custom retention, and full data control.
Tech / Self-Hosting
Spanlens is MIT-licensed and can be self-hosted using a simple Docker command. It supports OpenTelemetry (OTLP/HTTP) for ingestion and export, and offers configurable data retention policies. The platform is designed to minimize latency overhead (p99 under 3ms) and ensures requests complete even if ingestion fails.