Integrations
What the JavaScript SDK records in each framework and library, with OpenTelemetry's instrumentations it brings along.
Tracepanel for JavaScript records through OpenTelemetry's instrumentations, which come with the package. You don't install or configure them. A library your app doesn't use is never loaded.
Frameworks
| Framework | What a trace gets |
|---|---|
| Express | Each request with its route, such as /api/books/:id, and the handler that served it. |
| Fastify | Each request with its route, a plugin's prefix included, and the handler that served it, with the line that added the route. An error answered below 500 is the response. |
| Koa | Each request with its @koa/router route, a nested router's prefix included, and the handler that served it. ctx.throw() below 500 is the response. The answer Koa gives an error carries the trace's headers too, so the panel lists that request. |
| Hono | Each request with its route, a sub-app's base path included, and the handler that served it, on Node and on Bun. An HTTPException below 500 is the response. |
| NestJS | The controller method as the handler, such as BooksController.list, and the records of Nest's Logger. An HttpException below 500 is the response, not an error. |
| Next.js | Each page and route handler, named by its route, such as /api/books/[id]. |
| Nuxt | Each request named by its route, and the errors h3 answers with a 500. |
| Bun | Each route of Bun.serve under its pattern, or any fetch handler wrapped in withTracepanel(). |
See Installation to add each one.
Libraries
| Library | What Tracepanel records |
|---|---|
pg, mysql2 | Each SQL statement, with the line of your code that ran it, and EXPLAIN in the console. Drizzle, Knex, Sequelize, TypeORM and Prisma's driver adapters run on these drivers, so their SQL shows too. BEGIN … COMMIT or ROLLBACK on a pg client or a mysql2 connection is a transaction, with its savepoints and the statements and calls made inside it. |
better-sqlite3, node:sqlite, libsql | Each SQLite statement, with its values, the database file's name, the rows a read returned and the line of your code that ran it. BEGIN … COMMIT and better-sqlite3's db.transaction() are transactions. EXPLAIN in the console runs EXPLAIN QUERY PLAN on the app's own connection, so a database in memory has a plan too. |
| Prisma | Its operations, as steps over their SQL. |
ioredis, redis | Each Redis command, with its own N+1 and duplicates. |
| MongoDB | Each command, with its own N+1 and duplicates. |
fetch(), node:http | Each outgoing HTTP call, from fetch() and from clients on node:http, such as axios. |
| AWS SDK v3 | Each command a client of @aws-sdk/client-* sends, named as AWS names it, such as S3 PutObject avatars/1.png. See AWS. |
openai, @anthropic-ai/sdk | Each chat completion, response and embeddings call of OpenAI's SDK, and each message of Anthropic's, streamed or not. See LLM calls. |
| AI SDK | Each call of its OpenAI and Anthropic providers, such as generateText() with openai("gpt-5"). See LLM calls. |
| BullMQ | Each job a worker runs, as a task, and each job the app adds, as a step. The jobs in flight and the workers show in the Tasks page's Now, with each job's data as JSON, cut to 200 characters and masked. |
console | Each call made during a request or a task, as a log record of it. A console.dir(), console.table() or console.log() of an object is a dump. See Dumps. |
| pino, winston | Each record made during a request or a task, on the same levels as console's. A pino child's bindings and winston's metadata become extra. fields, secrets masked, and an error's stack is the record's exception. |
An error thrown in a handler comes with its stack, and your frames with their
source and their local variables. Node's inspector reads the variables as the
error is thrown. It reads them in your own frames only, and only while a trace
runs, such as a request's or a job's. Each value is kept as text and masked
under a secret's name, as is a value inside it under a key that names one,
such as { password: '********' }. A long value is cut, and a proxy is shown
without running its traps. Each read costs about a
millisecond, and there are at most 50 a second. A frame that waited on an
await has none, and Bun has none. TRACEPANEL_CAPTURE_LOCALS=0 turns them
off. A process under a debugger is left alone.
In bundled, transpiled or minified code, a frame is mapped to your source
through the bundle's source map: an inline one, or the .map beside the
bundle. A bundle a dev server rebuilds is mapped through its new map. A
function is named as your source names it, such as placeOrder or
Cart.checkout, not as the minifier renamed it, in an error's frames, a
query's line and a profile's flame graph.
A SQL statement, Redis command or MongoDB command that no code of yours made,
such as a session store's query before any handler runs, records the
library's line that asked for it as code.caller. That is the first line past
the driver and the ORM. The panel shows it marked as a library's.
Dumps
A console call that looks into a value is recorded as a dump, not as a log
line. The console prints it as before:
console.log("loaded", order);
console.dir(order, { depth: 4 });
console.table(rows);console.dir() and console.table() are always dumps, of their first
argument. A console.log(), console.debug() or console.info() is a dump
when an argument is an object, an array, a Map or a function. A call with
only strings, numbers and errors stays a log line, an error's stack as the
record's exception.
Only your own code's calls are dumps. A library's console calls stay log
lines.
Each argument keeps the source text it was written as, read from the call's
line, such as order, its value as Node's util.inspect prints it, its type
and its length. The call tree always shows a dump, as a DUMP row.
In bundled or transpiled code, such as esbuild's, tsc's, Vite's or a Next.js
dev bundle, the call is found in your source through the source map, inline
or the .map beside the bundle, with --enable-source-maps too. The source
text is read from the map's sourcesContent when it has it. In minified code
the call site names the function as your source does, such as placeOrder
or Cart.checkout, not as the minifier renamed it. When the source can't be
read, the values come alone.
An argument whose source text names a secret, such as apiToken or
password, is masked. So is a value under a secret's name inside an
argument: an object's key, a class's field or a Map's key. The SDK masks a
copy for the dump: your value isn't changed, no getter runs, and the
console prints it as before. A value it can't copy, such as a class whose
inspect reads its #private fields, and a proxy, shown without running
its traps, are masked in their printed text, as in apiKey: '********'.
Names are read word by word: see Dumps.
A value is cut at 16 KB. A call outside a request or a job isn't recorded.
TRACEPANEL_DUMPS=0 turns dumps off: a console.log() of an object is a log
line again, and console.dir() and console.table() aren't recorded. See
Dumps for where dumps show.
GraphQL
GraphQL Yoga and Apollo Server take Tracepanel's plugin, from
@tracepanel/js/graphql. Load Tracepanel and your framework's middleware as
in Installation, then add
the plugin. GraphQL Yoga, here on Express:
import { createYoga } from "graphql-yoga";
import { tracepanelYogaPlugin } from "@tracepanel/js/graphql";
const yoga = createYoga({ schema, plugins: [tracepanelYogaPlugin()] });
app.use(yoga.graphqlEndpoint, yoga);Apollo Server:
import { ApolloServer } from "@apollo/server";
import { tracepanelApolloPlugin } from "@tracepanel/js/graphql";
const server = new ApolloServer({
typeDefs,
resolvers,
plugins: [tracepanelApolloPlugin()],
});Each request is named after its operation, such as GraphQL query Books, so
the console's GraphQL page lists your operations rather than one
POST /graphql. An operation without a name is named after what it asks
for, such as GraphQL query { books, authors }. The operation is a step with
its parse and validate phases, and each of your resolvers is a step, such
as Book.author, with the queries and calls it makes under it. Fields
without a resolver of their own are left out.
An exception a resolver throws is the request's error, on its resolver's
step, even though the client gets it in errors with HTTP 200. A
GraphQLError your resolver answers with is not an error, and neither is a
client's syntax or validation error. The variables are in the request's body,
with the values under a secret's name masked.
AWS
Each command a client of the AWS SDK's v3 packages sends is a span named as
AWS names it, such as S3 PutObject avatars/1.png or DynamoDB Query users.
It holds the service, the operation, the region, the request id, the SDK's
retries and the error code of a failed call, such as NoSuchKey. The HTTP
requests of a command are part of its span, not calls of their own.
Each service lands where its kind of call does:
- S3 calls are storage calls, with the bucket and the key as the path. The console's Storage page lists them.
- DynamoDB calls are datastore commands, with the request's shape as the
statement and its values kept apart, as SQL's are. The Document client's
commands, from
@aws-sdk/lib-dynamodb, are the same. - SQS's
SendMessageand SNS'sPublishare messages. - Any other service, such as Lambda, is an RPC call.
The N+1 and duplicate checks apply to all of them. The console's AWS page lists every call. See AWS.
LLM calls
Each call to a model through OpenAI's openai SDK or Anthropic's
@anthropic-ai/sdk is an llm span, streamed or not: OpenAI's chat
completions, responses and embeddings, and Anthropic's messages. So is each
call of the AI SDK's OpenAI and Anthropic providers, and any other fetch() of
these APIs. A span is named after the operation and the model, such as
chat gpt-5. It holds OpenTelemetry's GenAI attributes: the provider, the
model asked for and the one that answered, the request's settings, the finish
reasons, the tools the model called and the tokens used, cached and reasoning
ones included. A stream's span lasts until its last chunk arrives, and records
the time to its first chunk. A call through an SDK is one span with its
retries, and a rate limit or an overloaded API is an error. Tracepanel leaves
the messages themselves out.
The agent estimates each call's cost from its tokens and a dated table of list
prices. A model the table doesn't list has no cost. To add models or change
prices, put an llm-prices.json of the same shape as the agent's in the
store's directory, .tracepanel/. See LLM calls
for what the console shows.
What a request carried
Each request records its headers, query, cookies and the response's headers
for the panel's Request tab. Values under secret names,
such as password, token, session, csrf and api_key, are masked, and
Set-Cookie always is. A name is read word by word, as in every SDK:
authToken and x-api-key are masked, author and max_tokens aren't. See
Privacy and safety. An outgoing
call's query also masks key, sig, pwd and credential as whole words.
The body is recorded as far as the app read it, up to 64 KiB. Express and
NestJS record what a body parser left in req.body, Fastify what it parsed
into request.body, and Koa what a body parser left in ctx.request.body.
Next.js, Nuxt, Hono, Bun.serve and handlers under withTracepanel(), such
as Elysia, record the pieces the app read as they pass, and never read the
body for it. JSON and forms have their secrets masked, and a JSON body or a
URL-encoded form past the limit is left out. A text body is cut at the
limit, and a binary body is left out. A multipart form keeps its fields, and
its files by name and size only.
The response's body is recorded as the app sent it, with its size in bytes,
for the panel's Request tab: what a GraphQL server, an API route or a handler
answered. JSON and forms have their secrets masked, and text is kept as it
is. A body past the limit is cut there and marked as cut. A stream, such as
Server-Sent Events, NDJSON or a body written in pieces without a
Content-Length, a compressed body, a page and its assets, binary content
and JSON past 4 MiB are recorded by their size only. A page's size is the
app's own, without the widget's script. The body passes a tap on its way
out: nothing waits for it, and the client gets it unchanged. It works in
Node's HTTP server, Express, Fastify, Koa, Next.js route handlers, Hono,
Bun.serve, GraphQL Yoga and Apollo Server.
TRACEPANEL_MAX_BODY_KB sets how much of a body is kept, 64 by default, and
TRACEPANEL_CAPTURE_BODY=0 leaves the bodies of requests and of their
responses out. They match the Python SDK's max_body_kb and capture_body.
The session is recorded as the handler left it, under session.: from
express-session or cookie-session in Express and NestJS, from
request.session in Fastify and ctx.session in Koa, and from h3's
useSession() in Nuxt, nuxt-auth-utils' session among them. Each value is
kept as text and cut when long, as an error's local variables are. A value
under a secret's name is masked at any depth, such as a token inside the
session's user. nuxt-auth-utils' secure data is always masked.
Next.js, Hono and Bun have no session of their own, and a sealed cookie, such
as iron-session's or Auth.js's, can't be read without the app's secret. Name
the signed-in user there with
setUser().
TRACEPANEL_CAPTURE_REQUEST=0 turns it all off.
Profiles
A request with the panel's Profile button on, or an X-Tracepanel-Profile: 1
header, is profiled in Express, Fastify, Koa, Hono, NestJS, Next.js, Nuxt
and under withTracepanel() on Node. See Profile. V8's profiler
runs only while traces are profiled. It samples the whole process, so a
profile keeps what was sampled while its request was the only one running.
The samples taken while other requests ran are dropped and counted in the
trace's tracepanel.dropped_samples. Each sample counts in the 10 ms of the
trace it was taken in, by V8's own time of it. The idle event loop's
samples, the request waiting on I/O or a timer, are one waiting stack,
event loop. The console splits the trace's time by them as it does every
language's: a query is Database, the code's own time Your code, the
framework's or Waiting. Every profile counts the garbage collector's runs
and their pauses. Bun has no profile.
A profiled trace says why in profile.reason: setting for
TRACEPANEL_PROFILE=1, header for an X-Tracepanel-Profile header,
cookie for the panel's button, parent for a call or a job from another
profiled trace, or code for profile().
A trace profiled because it asked, by a header, the cookie, its caller or
profile(), passes the ask on. Its outgoing calls carry the same
X-Tracepanel-Profile value, and the BullMQ jobs it adds carry a
tracepanel-profile option, 1 or memory, so the worker profiles the
job's trace. A job that sets the option itself keeps it. A trace only
TRACEPANEL_PROFILE=1 profiles asks nothing of them.
A profile counts memory too when asked: the Profile button's memory mode,
X-Tracepanel-Profile: memory, the tracepanel_profile=memory cookie, or
TRACEPANEL_PROFILE_MEMORY=1 for every profiled trace. V8's sampling heap
profiler takes about one allocation in every 32 KB, with its stack. The
profile shows the heap's peak above where the request started, what V8
allocated in all (on Node 26), and the 50 sites whose allocations still
lived at the request's end. The heap is the whole process's, so a request
that ran beside others says so.
It costs: code runs about 15% slower while it is sampled, and reading the sampler's profile makes V8 collect the whole heap at the end of each such request, after its response. That stops the process for a few milliseconds on a heap of tens of MB, and for over 100 ms on a few hundred MB. Leave it off when you measure time.
Pages and redirects
A streamed HTML page gets the panel too: one written in pieces without a
Content-Length in Express, a stream sent by Fastify or set as Koa's body,
or a ReadableStream body from Hono, Bun.serve or a handler under
withTracepanel(). A compressed page, or one that declares its size, is left
as it is.
A redirect that answers a page's navigation, such as a form's POST, sets a
short-lived cookie in Express, Fastify, Koa, Hono, Next.js, Nuxt and under
withTracepanel(), so the panel on the next page lists the POST first.
Calls between apps
A request that carries a W3C traceparent continues the caller's trace, and
the agent links the two. Calls your app makes carry it too, so the app they
reach links back. See
Traces across apps.
Pages in the browser
The pages of a single-page app record in the browser, with the Vite plugin,
Angular's provideTracepanel() or record(). See
Pages in the browser and
Angular.