Tracepanel

Installation

Install Tracepanel for Node.js and Bun, add it to your Express, NestJS, Next.js, Nuxt or Bun app, and open the panel.

Tracepanel for JavaScript is the @tracepanel/js package. It records the traces of your Node.js or Bun app and sends them to the agent.

The current version is 0.2.0, the same as the agent's. npm install @tracepanel/js installs the agent of the same version. See the changelog.

Install the package

npm install @tracepanel/js

The package also installs @tracepanel/agent, the program that stores the traces and serves the console. You don't install or start it yourself. See How it works. It brings OpenTelemetry's instrumentations with it, so there is nothing else to install.

Add it to your app

Tracepanel loads before your app, so it can hook the HTTP server, the framework and the database driver as they load. Each framework gets it in its own way.

Start the app with Tracepanel loaded before it:

node --import @tracepanel/js/register server.js

Add the middleware. It puts the badge on HTML pages and gives every response its trace's headers:

import express from "express";
import { tracepanel } from "@tracepanel/js/express";

const app = express();
app.use(tracepanel());

Tracepanel supports Express 4.18 and newer.

Tracepanel is on unless NODE_ENV is production. Open a page of your app and click the badge in the corner. The first request starts the agent, and the console is at /__tracepanel__/ on your app.

For a single-page app on Vite's dev server, add the Vite plugin. See Pages in the browser.

Start without the flag

The --import flag is how Tracepanel gets in before your app. An ES module's imports all load before any of its code runs, so import "@tracepanel/js/register" at the top of server.js comes too late for Express and the database driver.

Without the flag, let the tracepanel command add it:

{ "scripts": { "dev": "tracepanel run node server.js" } }

Or start from a file that loads Tracepanel, then imports your app:

// main.js, run with `node main.js`
import "@tracepanel/js/register";
await import("./server.js");

The agent starts by itself either way, on the app's first request.

Supported versions

Tracepanel for JavaScript runs on Node.js 20.19 and newer, and on Bun. See Integrations for the frameworks and libraries it records.

The agent comes for the same platforms as with Python:

  • Linux on glibc: x86_64, arm64, armv7, i686, ppc64le, s390x and riscv64.
  • Linux on musl, such as Alpine: x86_64, arm64, armv7, armv6 and i686.
  • macOS: Apple silicon and Intel.
  • Windows: x86_64, x86 and arm64.

Keep .tracepanel/ out of your repository:

echo ".tracepanel/" >> .gitignore

On this page