npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@allstak/fastify

v0.2.2

Published

AllStak SDK for Fastify (beta). Plugin with redaction, batching, retry, sampling, and beforeSend.

Readme

@allstak/fastify

AllStak SDK for Fastify. Captures inbound requests, errors, server spans, and distributed trace headers with one plugin.

Install

npm install @allstak/fastify fastify

Setup

import Fastify from 'fastify';
import allstakFastify from '@allstak/fastify';

const app = Fastify();

await app.register(allstakFastify, {
  apiKey: process.env.ALLSTAK_API_KEY,
  environment: process.env.NODE_ENV ?? 'production',
  release: process.env.ALLSTAK_RELEASE,
  serviceName: 'checkout-api',
  captureRequestHeaders: true,
});

app.get('/health', async () => ({ ok: true }));
await app.listen({ port: 3000 });

What is captured

Everything below is automatic after register — no per-call code.

  • Request method, path, host, status code, duration, environment, release, and service.
  • Unhandled route errors with stack traces and request correlation.
  • Fatal crashes: process-global uncaughtException and unhandledRejection are captured at fatal level, mark the release-health session crashed, and are flushed before the process exits (Node exit semantics preserved).
  • Database queries: pg, mysql2, and the SQLite family (better-sqlite3 / sqlite3 / node:sqlite) are auto-instrumented when installed — normalized SQL, query type, duration, status, rows affected, and the request's trace/span ids.
  • Logs: Fastify's pino logger is bridged so application and framework logs ship to AllStak (your stdout logs are unchanged). Error/fatal logs are promoted with throwable details; every log carries the request trace/span ids.
  • Breadcrumbs: an http breadcrumb is recorded per inbound request and attached to any error captured during that request.
  • Server spans for each request, plus outbound HTTP client spans.
  • Response propagation headers: traceparent, baggage, allstak-baggage, x-allstak-trace-id, and x-allstak-request-id.

Each feature is default-on and independently toggleable (see Configuration). To record DB queries, install the relevant driver in your app:

npm install pg              # PostgreSQL
npm install mysql2          # MySQL
npm install better-sqlite3  # SQLite

Configuration

| Option | Description | | --- | --- | | apiKey | Project API key. | | dsn | Alias for apiKey. | | environment | Deployment environment. | | release | App version or commit SHA. | | serviceName | Logical service name. | | captureRequestHeaders | Capture redacted inbound headers. Default: false. | | sampleRate | Request capture sample rate from 0 to 1. | | beforeSend | Optional hook to modify or drop outbound telemetry. | | enableDbInstrumentation | Auto-instrument pg / mysql2 / SQLite drivers. Default: true. | | enableLogBridge | Bridge Fastify's pino logger to AllStak logs. Default: true. | | logBridgeMinLevel | Minimum log level forwarded. Default: info. | | enableAutoBreadcrumbs | Record an http breadcrumb per request. Default: true. | | enableCrashHandlers | Install process-global crash handlers. Default: true. | | captureOutboundHttp | Instrument outbound HTTP egress. Default: true. | | enableAutoSessionTracking | Open a release-health session per process. Default: true. | | enableOfflineQueue | Persist un-sent telemetry to disk and replay on restart. Default: true on Node. |

Privacy

Sensitive header and metadata keys are redacted before telemetry is sent. Add redactKeys for application-specific fields.

Troubleshooting

  • No events: confirm the API key is present and the plugin is registered before routes.
  • Missing request correlation: keep upstream traceparent or x-request-id headers when proxying traffic.
  • Short-lived tests or scripts: wait briefly or call the plugin transport shutdown in your test harness.

Contributing and Support

  • Report bugs with the GitHub bug report template: https://github.com/AllStak/allstak-fastify/issues/new/choose
  • Open pull requests using the checklist in CONTRIBUTING.md.
  • Report security vulnerabilities privately through SECURITY.md.

License

MIT