Docs▸Node SDK

What Vigilon tracks

Vigilon traces Express and Fastify apps automatically, along with PostgreSQL, MySQL, MongoDB, Redis and outgoing HTTP calls, with no code changes. This page lists every library it tracks and shows how to leave out routes you do not want to monitor.

What Vigilon tracks automatically

Once Vigilon starts, it tracks every supported library your app uses. There is nothing to turn on per library. Each request to your app becomes a trace. Database queries and outgoing calls made during that request appear inside it as spans. A span records the timing and details of one operation.

Web frameworks: Express and Fastify. Requests to a plain Node.js http or https server are tracked too.

Outgoing HTTP calls: http, https, the built-in fetch, and undici.

PostgreSQL: pg.

MySQL: mysql and mysql2.

Other datastores: MongoDB, and Redis through redis and ioredis.

AWS: Lambda invocations when running inside AWS Lambda.

Vigilon sends traces. The endpoint and job numbers in your dashboard are worked out from them, so there is nothing else to set up.

Background jobs are not tracked automatically. Wrap each job with withJobMonitor as described in the Background jobs guide.

Express and Fastify

Express and Fastify apps need no code changes. Start the app with the --import flag from the quickstart and every request is traced, in CommonJS and ES module apps alike.

Express: each request gets spans for its route handler and middleware, and the route template, such as /users/:id, is recorded on the request.

Fastify: each request gets spans for its route handler and hooks. Vigilon registers its Fastify plugin on every Fastify instance for you, so there is nothing to add with app.register. A complete Fastify app looks like this:

server.mjs
import Fastify from "fastify";

const app = Fastify();

app.get("/users/:id", async (request) => {
  return { id: request.params.id };
});

await app.listen({ port: 3000 });

Start it with Vigilon:

shell
node --import @vigilon/node/register server.mjs

If requests show up but their Express or Fastify spans are missing, the framework was loaded before Vigilon started. With the preload, that happens when an ES module app is started with --require instead of --import.

Exclude health checks or other routes

Health checks and similar routes add noise. Vigilon leaves out /health, /ready, and /favicon.ico by default. Excluded routes do not appear in Traces or Endpoints.

To leave out more routes, list them in an environment variable, separated by commas:

shell
export VIGILON_EXCLUDED_URLS="/metrics,/internal/status"

Each value has to match the request URL exactly, including any query string. /metrics leaves out /metrics, but not /metrics/ or /metrics?format=json. Your values are added to the defaults; they do not replace them.