Skip to content

Traces and logs for TanStack Start apps

By where the app runs: your own Node.js server, your own Cloudflare account, or Lovable hosting.

Markdown
On this page

What works for traces and logs depends on where your TanStack Start app runs. Errors work everywhere with @belvador/tanstack-start.

Where it runsTraces and logs
Your own Node.js server (node .output/server/index.mjs or similar)The Node.js recipe
Your own Cloudflare accountCloudflare's built-in export
Lovable hostingNot available yet — see below

On your own Node.js server#

The built server is an ES module, so use the ES modules launch line — both the loader hook and the register file:

Terminal
export OTEL_SEMCONV_STABILITY_OPT_IN=httpexport OTEL_NODE_RESOURCE_DETECTORS=env,host,osnode --experimental-loader=@opentelemetry/instrumentation/hook.mjs --import @opentelemetry/auto-instrumentations-node/register app.mjs

Replace app.mjs with your server entry. The auto-instrumentations create a server span for each request and client spans for outgoing fetch and database calls; server functions show up as requests to their /_serverFn/… URLs, not as named spans. For named spans around your own code, use @opentelemetry/api (tracer.startActiveSpan).

Pass the same API to the Belvador SDK's otel option so server errors carry the active span's ids — see Link requests.

On your own Cloudflare account#

Add the two destinations and the observability block from Cloudflare Workers to the app's wrangler.jsonc. Cloudflare then traces every request, fetch and binding call with no code.

On Lovable hosting#

Lovable publishes your app to Cloudflare under its own account, so you cannot add Cloudflare export destinations, and starting a Node.js SDK in a Worker is not possible. Use the Belvador SDK for errors and its trace headers to link browser and server errors. In-app OpenTelemetry for Workers exists in community libraries, but Belvador has not tested any.

Status#

The Node.js launch line is the certified Node.js recipe; Belvador has not run it on a TanStack Start build specifically. The Cloudflare route follows Cloudflare's documentation and is untested.

Spotted something wrong or missing? Tell us: hello@belvador.dev