LLM observability tool that logs every OpenAI, Anthropic, Gemini and other provider call with cost, tokens, latency and agent traces. Works by changing the base URL or using a drop-in SDK; self-hostable with Docker
Overview
Spanlens is an LLM observability and monitoring platform. You point your OpenAI, Anthropic or Gemini client at its proxy, or use its drop-in SDK, and every call is logged with model, provider, tokens, cost, latency and the full request and response body. Streaming responses are reconstructed, and logs are saved asynchronously so they stay off the critical path. Other providers such as Mistral, Groq, DeepSeek, xAI, OpenRouter, Cohere and Azure are routed the same way, and a single unified project key covers all of them.
Beyond the request log, it offers agent tracing as span trees with a critical-path view, per-request cost breakdowns with daily rollups and budget alerts, prompt-cache savings, and per-end-user analytics. Anomaly detection compares latency, cost and error rate with a 7-day baseline. Alerts go out by email, Slack or Discord. PII and prompt-injection scanning can flag or optionally block requests, and a per-request header controls how much of each body is stored.
For prompt and quality work it includes prompt versioning with A/B experiments, a playground, datasets, and LLM-as-judge evals with human annotation. It also offers opt-in exact-match response caching, model recommendations for cheaper alternatives, outbound HMAC-signed webhooks, OTLP/HTTP trace ingest, CSV and JSON export, and an OpenAPI spec. Integrations cover the Vercel AI SDK, LangChain, LlamaIndex and Ollama, plus a CLI and an MCP server for querying data from Cursor or Claude Desktop.
Teams get workspaces, projects, admin, editor and viewer roles, invitations and an audit log. Data is stored in Supabase Postgres. A hosted version is available with free and paid tiers, and the server can also be run yourself from a Docker image, with configurable retention.
Key features
- Drop-in proxy for OpenAI, Anthropic, Gemini and more
- Request log with cost, tokens and latency
- Agent tracing with span trees
- Anomaly detection and alerts
- PII and prompt-injection scanning
- Prompt versioning and A/B experiments
- LLM-as-judge evals and datasets
- OTLP ingest and MCP server
Use cases
- Tracking LLM spend per model, feature or end user
- Debugging multi-step agent runs
- Comparing prompt versions on real traffic
- Detecting cost spikes and error bursts
- Self-hosting LLM logging for privacy