Crashless Documentation
Welcome to Crashlessโproduction-ready observability for Node.js with zero npm dependencies.
๐ Quick Startโ
npm install crashless
import express from 'express';
import crashless from 'crashless';
const app = express();
app.use(crashless()); // That's it!
app.listen(3000);
// Dashboard: http://localhost:3000/_crashless
โถ๏ธ Try Interactive Examples
โจ Key Featuresโ
๐ก๏ธ Automatic Error Handlingโ
Catch all errors automaticallyโno try-catch needed. Prevents server crashes from unhandled errors.
app.use(crashless());
// Async errors - automatically caught
app.get('/data', async (req, res) => {
const data = await fetchData(); // ๐ก๏ธ Safe
res.json(data);
});
๐ Built-in Dashboardโ
Real-time observability dashboard with three powerful views:
- System Dashboard - Request metrics, throughput, latency, route performance
- Errors Dashboard - Error frequency, top failing routes, live error stream
- Traces Dashboard - Request traces with waterfall visualization
Access: http://localhost:3000/_crashless
๐ Distributed Tracingโ
Automatic tracing for HTTP requests, fetch() calls, and fs.readFile() operations.
app.use(crashless({
telemetry: {
traces: {
enabled: true,
samplingRate: 0.2 // Sample 20% of requests
}
}
}));
Export traces: GET /traces.json?format=otlp - OpenTelemetry OTLP format
๐ OpenTelemetry Supportโ
Full OpenTelemetry compatibility for metrics and traces.
app.use(crashless({
telemetry: {
engine: 'otel' // OpenTelemetry format
}
}));
Endpoints:
GET /metrics/otel- OpenTelemetry metricsGET /traces.json?format=otlp- OTLP trace export
๐ Prometheus Metricsโ
Prometheus-compatible metrics export for Grafana integration.
app.use(crashless({
telemetry: {
engine: 'prometheus'
}
}));
Endpoint: GET /metrics - Prometheus format
๐ Custom Exportersโ
Integrate with Sentry, Datadog, or any monitoring service.
app.use(crashless({
exporters: [
{
name: 'sentry',
onError: (error, metadata) => {
Sentry.captureException(error, { extra: metadata });
}
}
]
}));
โก Zero Dependenciesโ
Uses only Node.js built-ins. No external npm dependencies.
๐ Production-Safeโ
- Sensitive data masked automatically
- IP whitelist & token authentication
- Dashboard disabled in production by default
- Configurable overhead (2-30%)
๐ฎ Try It Liveโ
Interactive Examples:
- ๐ One-Liner Setup - Simplest possible setup
- ๐ Full Featured Demo - All features enabled
- ๐ OpenTelemetry Integration - OTel metrics & traces
- ๐ Prometheus Export - Prometheus-compatible metrics
- ๐ Custom Exporters - Sentry, Datadog, custom integrations
- ๐ก๏ธ Production Dashboard - Secure production setup
๐ Documentationโ
Getting Startedโ
- Installation & Setup - Step-by-step guide
- Configuration - All configuration options
- API Reference - Complete API documentation
Features & Integrationsโ
- OpenTelemetry Integration - OTel setup guide
- Prometheus Export - Prometheus setup
- Custom Exporters - Sentry, Datadog, etc.
- Distributed Tracing - Trace configuration
Advanced Topicsโ
- Performance - Benchmarks and optimization
- Security - Security best practices
- Architecture - How Crashless works internally
- Limitations - Trade-offs and limitations
๐ฏ Common Use Casesโ
Minimal Setup (Error Handling Only)โ
app.use(crashless({
telemetry: { engine: 'none' }
}));
Overhead: ~3% | Use case: High-traffic apps needing only error handling
Standard Productionโ
app.use(crashless({
telemetry: { engine: 'builtin' }
}));
Overhead: ~20% | Use case: Standard production with metrics
Production + Observabilityโ
app.use(crashless({
telemetry: {
engine: 'builtin',
traces: { enabled: true, samplingRate: 0.2 }
}
}));
Overhead: ~27% | Use case: Full observability with distributed tracing
OpenTelemetry Integrationโ
app.use(crashless({
telemetry: {
engine: 'otel',
traces: { enabled: true }
}
}));
Use case: Integration with OTel collectors (Jaeger, Tempo, etc.)
Prometheus + Grafanaโ
app.use(crashless({
telemetry: {
engine: 'prometheus'
}
}));
Use case: Prometheus scraping for Grafana dashboards
๐ Performanceโ
Crashless is designed for performance:
- Minimal config: ~3% overhead vs plain Express
- With metrics: ~20% overhead
- Full observability: ~27% overhead (with 20% sampling)
- 2.2x faster than express-async-errors
See Performance Guide for detailed benchmarks and optimization strategies.
๐ Resourcesโ
- ๐ฆ npm Package
- ๐ป GitHub Repository
- ๐ฎ Examples Repository
- ๐ Report Issues
- ๐ฌ Discussions
Next Stepsโ
- Getting Started Guide - Step-by-step setup
- Configuration Options - Customize Crashless
- Examples - Real-world usage patterns
- API Reference - Complete API documentation