DevLens

Troubleshooting

Most problems show up in the browser's Network tab as a response from /api/ingest. Find the symptom below, check the cause, apply the fix.

No traces appear

Open your app, open the browser's developer tools, go to Network and filter by ingest. Then use the app.

You seeCause and fix
No request to /api/ingestinit never ran, or the action isn't wrapped. Render the init component once in your root layout, wrap the action with track, and use the fetch it hands you. Spans are sent about two seconds after an action.
401The key isn't recognised: a typo, or a key from another DevLens dashboard. Copy the public key again from Keys & settings and restart the dev server so Next.js picks up the new environment. A lost secret key can be replaced there too.
403The page's address isn't one of the project's allowed origins. They must match exactly, including the port: http://localhost:3000 is not http://127.0.0.1:3000. Edit them in Keys & settings.
429More than 600 spans in a minute for this project. The SDKs pause for a minute and carry on.
413 or 400The batch was too large or malformed. Update both SDKs to the same version.
202, but nothing in the listYou may be looking at another project. Check the key's project, and that the endpoint points at this dashboard.

Browser steps appear, server steps don't

With OpenTelemetry (any language other than Next.js), see OpenTelemetry traces don't arrive below. With the Next.js SDK:

  • The server needs DEVLENS_SECRET_KEY and the endpoint in its environment. Without them it records nothing, on purpose, so your app keeps working.
  • Each route must be wrapped with withDevLens and use the Node.js runtime: export const runtime = "nodejs".
  • Import your lib/devlens.ts (the file that calls configure) before the route runs.

Browser and server steps show up as separate traces

The server didn't receive the traceparent header that links them, or didn't continue it. The request must go through the fetch that track provides. With OpenTelemetry, the default propagator already continues traceparent; if you set OTEL_PROPAGATORS, keep tracecontext in it. For an API on another origin, list it in traceOrigins when you call init, and have that API allow the header in its CORS preflight (Access-Control-Allow-Headers: traceparent, content-type). Without that, the browser blocks the request, so only list APIs you control.

No file and line, or a path inside .next

  • Start Node with NODE_OPTIONS=--enable-source-maps. Without it there are no source maps to read.
  • Set repoRoot in configure to your repository's root, so paths come out relative to it.
  • Database spans only record a location when the query fails.
  • No location is ever guessed: if none of the stack points into your code, the field is left out.

Links need three things: a GitHub repository on the project, the full commit SHA passed as commitSha in configure, and a span sent by your server. See source links.

OpenTelemetry traces don't arrive

Most SDKs log export failures at startup or on their first batch. The dashboard answers:

ResponseCause and fix
401The x-devlens-key header is missing or wrong. Check OTEL_EXPORTER_OTLP_TRACES_HEADERS.
403A public key (pk_…) was used. OpenTelemetry needs the secret key (sk_…).
415The exporter isn't using HTTP, or compresses with something other than gzip. Set OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf (gRPC isn't supported); OTEL_EXPORTER_OTLP_COMPRESSION may be gzip or none.
413The request is over 1 MiB (after decompression), or holds more than 600 spans. Lower OTEL_BSP_MAX_EXPORT_BATCH_SIZE (the default, 512, fits).
404The endpoint is wrong. It must end in /api/otlp/v1/traces, and be set with the _TRACES_ variable, which is used as is.
200 with rejectedSpansSome spans had invalid ids, times or names and were dropped; the rest were stored.

A Python, Java or Go step with no file and line: set devlens.repo_root in OTEL_RESOURCE_ATTRIBUTES to your repository's path, so stack-trace paths can be made relative. See Connect a backend.

A card has a dashed border

Its parent step never arrived. Most often the browser tab closed before it could send its last spans: the SDK makes one attempt as the page closes, and that can be lost. The rest of the trace is still shown.

The confirm or reset email didn't arrive

  • Check your spam folder. The email comes from noreply@devlenshq.dev.
  • Links expire: reset links after one hour, confirm links after 24 hours. Each works once, and a newer email replaces the older link.
  • Ask again from Forgot password, or with Resend on the Projects page. At most 3 emails go to one address every 15 minutes.
  • Running your own DevLens? Set RESEND_API_KEY, EMAIL_FROM and APP_URL.

The AI agent can't reach DevLens

  • Read token rejected: the token was replaced or mistyped. Create a new one in Keys & settings and update the agent's config.
  • Trace not found in this project: the trace belongs to another project. Each read token covers one project.
  • In Claude Code, /mcp lists the server and whether it connected. Restart the agent after changing its config.