foglamp package to your app, and traces are sent to a backend you can run
yourself or use as a hosted service.
On AI SDK v4, v5, and v6, Foglamp wraps the
ai module with
foglamp/wrap. On v7 (beta), it uses the SDK’s built-in
telemetry API. Both produce the same traces. The Quickstart
helps you pick.Why Foglamp
One user action in an AI app can trigger several model calls, tool calls, and retries, each with its own cost and speed. Regular monitoring tools were not built for that. Foglamp is.Cost tracking
Every span is priced as it arrives, split by input, output, reasoning, and
cached tokens. If a model has no known price, you see a dash, never a wrong
$0.
Traces
Each
generateText or streamText call becomes a trace, with its steps and
tool calls as spans. Group them into agents, workflows, and runs.Latency
p50/p95/p99 latency and time to first token, read from the SDK’s own
metrics.
Self-host or hosted
Run the whole stack with
docker compose up, or point the SDK at the
hosted service. The code is the same either way.How it works
- SDK sits in your app, collects spans, and sends them in batches. If no API key is set it does nothing at all. It never throws and never slows down your model calls.
- Ingest API checks your API key, prices each span, and stores it.
- Dashboard shows traces, workflows, agents, sessions, cost, evals, and alerts. See the dashboard tour.
Next steps
Quickstart
Install the SDK and see your first trace in minutes.
Data model
Learn what traces, spans, workflows, runs, and sessions are.
SDK reference
Every option and integration method.
Dashboard tour
Traces, workflows, agents, sessions, evals, cost, and alerts.
Self-hosting
Run the full stack on your own servers.
Troubleshooting
Not seeing traces? Common causes and fixes.
.png?fit=max&auto=format&n=1sml0kwCw1BNtiz-&q=85&s=a7c846a133aa3480dc1e03a2da5fec2b)
.png?fit=max&auto=format&n=1sml0kwCw1BNtiz-&q=85&s=6534218552b79980770f11c40aafd6ec)