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

nestwatch-sdk

v0.1.1

Published

NestJS monitoring SDK for NestWatch

Readme

nestwatch-sdk

Open-source Application Performance Monitoring SDK for NestJS

npm version License: MIT

What is NestWatch?

NestWatch is a free, open-source APM (Application Performance Monitoring) tool designed specifically for NestJS applications. It provides:

  • 📊 Real-time Metrics - Request rates, latency percentiles, error rates
  • 🔍 Distributed Tracing - Track requests across your services
  • 🔗 Dependency Graph - Visualize module relationships
  • 🛤️ Route Discovery - Auto-detect all HTTP endpoints
  • 🚨 Alerting - Get notified when issues occur

Installation

npm install nestwatch-sdk

or with yarn:

yarn add nestwatch-sdk

Quick Start

1. Import and Configure

// app.module.ts
import { Module } from '@nestjs/common';
import { NestWatchModule } from 'nestwatch-sdk';

@Module({
  imports: [
    NestWatchModule.forRoot({
      serviceName: 'my-api',           // Required: Your service name
      collectorUrl: 'http://localhost:4317', // Collector URL
      debug: true,                     // Enable debug logging
    }),
    // ... other modules
  ],
})
export class AppModule {}

2. Start the Collector

The SDK sends telemetry data to a NestWatch Collector:

# Clone and run the collector
git clone https://github.com/UGilfoyle/nestjs-monitor.git
cd nestjs-monitor
docker-compose up -d
pnpm dev

3. View Your Dashboard

Open http://localhost:3100 to see your service metrics!

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | serviceName | string | required | Unique identifier for your service | | collectorUrl | string | http://localhost:4317 | URL of the NestWatch collector | | version | string | 1.0.0 | Service version (shown in dashboard) | | environment | string | development | Environment name | | debug | boolean | false | Enable verbose logging | | enabled | boolean | true | Enable/disable SDK | | resourceAttributes | object | {} | Additional OpenTelemetry attributes |

Advanced Configuration

Async Configuration

NestWatchModule.forRootAsync({
  imports: [ConfigModule],
  useFactory: (config: ConfigService) => ({
    serviceName: config.get('SERVICE_NAME'),
    collectorUrl: config.get('COLLECTOR_URL'),
    debug: config.get('NODE_ENV') === 'development',
  }),
  inject: [ConfigService],
});

Custom Decorators

@Trace() Decorator

Add tracing to any method:

import { Trace } from 'nestwatch-sdk';

@Injectable()
export class UserService {
  @Trace('fetch-user')
  async findOne(id: string) {
    return this.userRepo.findOne(id);
  }
}

@Metric() Decorator

Record custom metrics:

import { Metric } from 'nestwatch-sdk';

@Injectable()
export class PaymentService {
  @Metric('payment.processed', { type: 'counter' })
  async processPayment(amount: number) {
    // Payment logic
  }
}

What Data is Collected?

| Data Type | Description | |-----------|-------------| | Traces | HTTP requests, method calls with timing | | Metrics | Request rate, latency, error rate | | Module Graph | NestJS module dependencies | | Routes | All HTTP endpoints with metadata |

Dashboard Features

  • Overview - Service health at a glance
  • Traces - Request waterfall visualization
  • Metrics - Time-series graphs (P50/P95/P99)
  • Dependency Graph - Interactive module visualization
  • Route Explorer - All endpoints with guards/interceptors

Self-Hosting

NestWatch is designed to be self-hosted. You need:

  1. Collector (NestJS backend) - Ingests telemetry
  2. Dashboard (Next.js frontend) - Visualizes data
  3. PostgreSQL - Stores telemetry data

See the main repository for deployment instructions.

Requirements

  • NestJS 10.x or higher
  • Node.js 18.x or higher

License

MIT License - Free for personal and commercial use.

Links