Skip to main content
Foglamp gives you unified observability for agents built on the Vercel AI SDK — cost, latency, token usage, distributed traces, and full prompt/response logs — with two lines of code. It is TypeScript-only and works with every major version of the Vercel AI SDK — v4, v5, v6, and v7. You instrument your app with foglamp, and traces stream to a backend you can run yourself or use as a hosted service.
Foglamp meets the AI SDK where it is. On the stable v4, v5, and v6 lines it wraps the module with foglamp/wrap; on v7 (beta) it uses the native telemetry-integrations API. Same traces, same backend — the Quickstart helps you pick your path.

Why Foglamp

Generative apps fail in ways traditional APM never had to model: a single user action fans out into multiple model calls, tool executions, and retries, each with its own cost and latency. Foglamp is built around that shape.

Cost at ingest

Every span is priced as it arrives, broken down by input, output, reasoning, and cached tokens. Unknown models surface as , never a misleading $0.

Distributed traces

One top-level generateText/streamText call is a trace; its steps and tool calls are spans. Group them into agents, workflows, and runs.

Latency & TTFT

p50/p95/p99 latency and time-to-first-token, read straight from the SDK’s own performance metrics rather than guessed.

Self-host or hosted

Run the whole stack with docker compose up, or point the SDK at a managed endpoint. Same code either way.

How it fits together

your app ──foglamp──▶ ingest API ──▶ ClickHouse ──▶ dashboard
  • SDK — instruments your AI SDK calls, batching spans and flushing them fire-and-forget. Silent no-op when no API key is set; never throws, never adds latency to your model calls.
  • Ingest API — authenticates the API key, prices each span, and writes to ClickHouse.
  • Dashboard — traces, workflows, agents, sessions, cost-over-time, evals, and alerts. See the dashboard tour.

Next steps

Quickstart

Install the SDK and see your first trace in minutes.

Data model

Understand traces, spans, workflows, runs, and sessions.

SDK reference

Every configuration option and integration method.

Dashboard tour

Traces, workflows, agents, sessions, evals, cost, and alerts.

Self-hosting

Run the full stack on your own infrastructure.

Troubleshooting

Not seeing traces? The usual causes and fixes.