← All platforms

Fastify error tracking

Fast responses are lovely. A useful report when a handler breaks is lovely, too. Connect the Sentry Fastify integration to Telebugs on your server.

~/hoofnotes  npm install @sentry/node
~/hoofnotes  nvim instrument.mjs app.mjs
import * as Sentry from "@sentry/node";
Sentry.init({
// Copy the complete Telebugs DSN, key and path included.
dsn: "YOUR_TELEBUGS_DSN",
});
import Fastify from "fastify";
import * as Sentry from "@sentry/node";
import { routes } from "./hoofnotes/routes.mjs";
const app = Fastify();
Sentry.setupFastifyErrorHandler(app);
app.register(routes);
await app.listen({ port: 3000 });
~/hoofnotes  node --import ./instrument.mjs app.mjs

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep @sentry/node and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

Does this fit Fastify’s error handling?

Yes. The SDK has a Fastify error handler, so unexpected request exceptions can be reported without adding a capture call to every route.

And the browser side?

Use the browser SDK for frontend errors. Your server and browser reports can live in Telebugs together without sharing the same SDK setup.