Overview
Foglamp is an open-source observability layer built specifically for AI agents using the Vercel AI SDK. It records model cost, latency, time to first token, token usage, prompt and response data, distributed traces, evaluations, and alert conditions across generateText and streamText calls.
The SDK can send telemetry to Foglamp's hosted service or a self-hosted stack using Postgres, ClickHouse, Redis, and Docker Compose. It identifies agents, workflows, runs, sessions, and tools as first-class context, making it more focused than a generic application monitor. ToolWorthy readers comparing agent infrastructure can use the AI agent category and AI data analysis tools for adjacent options.
Foglamp is Apache-2.0 licensed and currently targets TypeScript with Vercel AI SDK versions 4 through 7. Teams on other SDKs should verify compatibility before adopting it.
Key Features
Cost intelligence - Calculates cost at ingest by model and token dimension, with custom price overrides and no misleading zero for unknown models.
Distributed traces - Displays top-level calls, model steps, and tool calls in a waterfall with inputs and outputs for each span.
Agent and workflow context - Groups telemetry by agent, workflow, run, session, project, and customer metadata.
Production evaluations - Scores live traffic with code checks or LLM judges to monitor answer quality after deployment.
Operational alerts - Evaluates thresholds for cost, latency, errors, tokens, request counts, and time to first token.
Hosted or self-hosted deployment - Use a managed endpoint or run the complete open-source stack on controlled infrastructure.
How to Get Started
Install the foglamp package, create an API key, and register the telemetry integration around Vercel AI SDK calls. Name each trace or agent so the resulting data can be grouped meaningfully.
Before enabling prompt and response capture in production, decide whether sensitive data should be recorded. The SDK supports disabling input or output recording, and self-hosting can keep telemetry on infrastructure the team controls. Developers evaluating broader open-source agent stacks may also compare Pi Monorepo.
Pricing & Plans
Foglamp offers hosted plans and an Apache-2.0 self-hosting option.
| Plan | Price | Main limits and features |
|---|---|---|
| Free | $0 forever | 10,000 spans/month, 3-day retention, 1 project, 1 alert, 5 evals |
| Pro | $49/month | 1,000,000 spans/month, 14-day retention, 5 projects, 10 alerts, 20 evals, AI assistant, email and Slack alerts |
| Enterprise | Custom | Custom spans and projects, 90+ day retention, SSO/SAML, audit logs, SLA and dedicated support |
| Self-hosted | Software is open source | Infrastructure, operations, and model-evaluation costs are the user's responsibility |
All hosted plans list unlimited agents, workflows, traces, sessions, and team members, subject to the monthly span allowance.
Best For
- TypeScript teams shipping agents with the Vercel AI SDK
- Developers investigating unexpected model-cost or latency changes
- AI product teams that need trace-level production debugging
- Organizations that prefer self-hosted observability
- Teams adding evaluations and operational alerts to live agent workflows
FAQ
What does Foglamp monitor?
Foglamp monitors model calls, tokens, cost, latency, time to first token, prompts, responses, tool calls, traces, evaluations, and alerts.
Is Foglamp free?
Yes. The hosted Free plan includes 10,000 spans per month and three days of retention. The source code is also available under Apache 2.0.
How much is Foglamp Pro?
Pro is listed at $49 per month with one million spans, fourteen-day retention, five projects, more alerts and evals, and priority support.
Which SDKs does it support?
The repository currently documents TypeScript and Vercel AI SDK versions 4 through 7.
Can Foglamp be self-hosted?
Yes. The repository includes Docker Compose services for the dashboard, ingest API, server, Postgres, ClickHouse, and optional Redis.
Does it record prompts and responses?
It can, but input and output recording are configurable. Teams should disable or redact capture where prompts may contain sensitive information.
How are unknown model prices handled?
Unknown models display no computed cost instead of a false zero. Teams can add custom price overrides for internal or unsupported models.
Does Foglamp replace application monitoring?
Not entirely. It focuses on AI SDK calls and agent behavior, while conventional monitoring is still useful for infrastructure, frontend, database, and non-AI application errors.




