Skip to content

polarsignals/pprof-nodejs

Repository files navigation

@polarsignals/pprof

Node.js profiling library that automatically uploads heap profiles to Polar Signals.

Installation

npm install @polarsignals/pprof

Usage

const { heapProfiler, monitorOutOfMemory } = require('@polarsignals/pprof');

// Start heap profiling
heapProfiler.start(512 * 1024, 64); // 512KB sampling, stack depth 64

// Monitor for out-of-memory events and auto-upload profiles
monitorOutOfMemory({
  exportOptions: {
    labels: {
      'service': 'my-app',
      'version': '1.0.0'
    }
  }
});

Configuration

Set your Polar Signals API token:

export POLAR_SIGNALS_TOKEN=your_token_here

Features

  • Automatic heap profile collection
  • Out-of-memory monitoring with automatic profile upload
  • Background upload process to ensure profiles are saved even during crashes
  • Configurable labels for profile metadata

About

Node.js profiling library that automatically uploads heap profiles to Polar Signals

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •