> ## Documentation Index
> Fetch the complete documentation index at: https://docs.foglamp.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> The missing observability layer for the Vercel AI SDK.

Foglamp gives you unified observability for agents built on the
[Vercel AI SDK](https://ai-sdk.dev) — 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](https://ai-sdk.dev) — 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.

<Note>
  Foglamp meets the AI SDK where it is. On the stable **v4, v5, and v6** lines
  it wraps the module with [`foglamp/wrap`](/sdk/wrap); on **v7 (beta)** it uses
  the native telemetry-integrations API. Same traces, same backend — the
  [Quickstart](/quickstart) helps you pick your path.
</Note>

## 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.

<CardGroup cols={2}>
  <Card title="Cost at ingest" icon="dollar-sign">
    Every span is priced as it arrives, broken down by input, output, reasoning,
    and cached tokens. Unknown models surface as `—`, never a misleading `$0`.
  </Card>

  <Card title="Distributed traces" icon="diagram-project">
    One top-level `generateText`/`streamText` call is a trace; its steps and tool
    calls are spans. Group them into agents, workflows, and runs.
  </Card>

  <Card title="Latency & TTFT" icon="gauge">
    p50/p95/p99 latency and time-to-first-token, read straight from the SDK's
    own performance metrics rather than guessed.
  </Card>

  <Card title="Self-host or hosted" icon="server">
    Run the whole stack with `docker compose up`, or point the SDK at a managed
    endpoint. Same code either way.
  </Card>
</CardGroup>

## 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](/dashboard/overview).

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Install the SDK and see your first trace in minutes.
  </Card>

  <Card title="Data model" icon="sitemap" href="/concepts/data-model">
    Understand traces, spans, workflows, runs, and sessions.
  </Card>

  <Card title="SDK reference" icon="code" href="/sdk/overview">
    Every configuration option and integration method.
  </Card>

  <Card title="Dashboard tour" icon="chart-line" href="/dashboard/overview">
    Traces, workflows, agents, sessions, evals, cost, and alerts.
  </Card>

  <Card title="Self-hosting" icon="docker" href="/self-hosting/overview">
    Run the full stack on your own infrastructure.
  </Card>

  <Card title="Troubleshooting" icon="bug" href="/troubleshooting">
    Not seeing traces? The usual causes and fixes.
  </Card>
</CardGroup>
