DevLens

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

  1. In the browser, @devlenshq/sdk-browser records the action you wrap with track and every request it makes. It adds a standard traceparent header to those requests so the server knows which trace they belong to.
  2. 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 with span and 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.
  3. 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.
  4. 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:

PartWorks with
Browser SDKAny web frontend: React, Vue, Svelte or plain JavaScript. The examples use Next.js, but nothing in the SDK needs it.
Server SDKNode.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 backendPython, 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 stepsPrisma with the server SDK (tested with Prisma 7). Through OpenTelemetry, any database its instrumentation covers.
Dashboard, AI export and MCP serverAnything above: they only see the recorded steps. The MCP server works with any agent that supports MCP.

In these docs