DevLens documentation
DevLens follows one user action from the browser, through your server, to the database. When something fails, it shows where, in plain words, and hands that evidence to your AI coding agent.
What you get
Every time someone uses your app, DevLens records a trace: the click, the request it sent, the server functions that ran and the database queries they made. Each of those steps is a span. When a trace fails, the dashboard:
- says where it broke before you click anything, for example Broke at DemoUser.create · P2002 · registration.ts:14;
- draws the trace as a graph in three lanes (Browser, Server, Database) with the failing path in red and the root cause as the one filled card;
- walks you through the failure step by step, in plain language built only from what was recorded;
- turns the failing path into a prompt you can paste into an AI coding agent, or that the agent fetches itself.
Want to see it first? The demo shows a real failure without an account.
How a click becomes a trace
- In the browser,
@devlenshq/sdk-browserrecords the action you wrap withtrackand every request it makes. It adds a standardtraceparentheader to those requests so the server knows which trace they belong to. - On the server, the request continues the same trace. A Next.js app uses
@devlenshq/sdk-node: it records the request, the functions you wrap withspanand every Prisma query. Any other backend (Python, Java, .NET, Go, PHP, Ruby, Node) uses OpenTelemetry, which records its requests, functions and database queries, mostly with no code changes. Either way, the file and line where an error was thrown are noted. - Both sides send their steps to the dashboard in small batches, in the background. They never slow down or change what your app returns: if DevLens is unreachable, steps are dropped and your app carries on.
- The dashboard joins the spans by trace, works out the failing path, and keeps them per project.
What it works with
DevLens is made of parts that depend on different things. Today:
| Part | Works with |
|---|---|
| Browser SDK | Any web frontend: React, Vue, Svelte or plain JavaScript. The examples use Next.js, but nothing in the SDK needs it. |
| Server SDK | Node.js 22.18 or newer. Built and tested for Next.js route handlers (Next.js 16, Node.js runtime, not Edge). withDevLens wraps any async function that takes a standard Request and returns a Response, so other Fetch-style servers can call it too, but only Next.js is tested. |
| Any other backend | Python, Go, Java, .NET, Ruby, PHP, Node and more, through OpenTelemetry: keep your usual setup and point its exporter at DevLens. Tested end to end with Python (Flask + SQLAlchemy), and with recorded traces from Node and Java. |
| Database steps | Prisma with the server SDK (tested with Prisma 7). Through OpenTelemetry, any database its instrumentation covers. |
| Dashboard, AI export and MCP server | Anything above: they only see the recorded steps. The MCP server works with any agent that supports MCP. |
In these docs
- Quickstart: Connect your app, in any language, and record your first trace.
- Connect a backend: Send traces from Python, Java, .NET, Go, PHP, Ruby and more with OpenTelemetry.
- Reading a trace: The trace list, the graph, the walk-through and the timeline.
- Handing off to AI: Copy the context, or let your agent fetch it over MCP.
- Security and privacy: Keys, what is stored, and what never is.
- Troubleshooting: No traces, unlinked spans, missing source lines.