A comprehensive examples repository demonstrating all Crashless features, from minimal one-liner setup to production-ready configurations with advanced telemetry and tracing capabilities.
- Installation
- Quick Start
- Examples Overview
- Example Details
- Dashboard Screenshots
- Configuration Reference
- Use Case Guide
- Resources
npm installRun any example using the provided npm scripts:
# Simplest setup with auto-configuration
npm run example:one-liner
# Minimal error handling without telemetry
npm run example:basic
# Production-ready configuration
npm run example:production
# Production with secure dashboard
npm run example:production-dashboard
# Comprehensive feature demonstration
npm run example:full| Example | File | Port | Key Features |
|---|---|---|---|
| One-Liner Setup | example-one-liner.js |
3010 | Auto-configured, zero-config dashboard |
| Basic | example-basic.js |
3001 | Error handling only, lightweight |
| Production | example-production.js |
3002 | Message masking, dashboard disabled |
| Production Dashboard | example-production-dashboard.js |
3000 | Secure dashboard with IP whitelist |
| Built-in Engine | example-builtin-engine.js |
3003 | Built-in telemetry with Prometheus export |
| Prometheus Engine | example-prometheus-engine.js |
3004 | Prometheus metrics endpoint |
| OpenTelemetry Engine | example-otel-engine.js |
3005 | OTLP-compatible metrics export |
| Custom Exporters | example-exporters.js |
3006 | Multiple custom exporters (Sentry, Datadog) |
| Full-Featured | example-full-featured.js |
3007 | Complete feature showcase |
| Automatic Tracing | example-automatic-tracing.js |
3000 | Zero-instrumentation tracing |
| Tracing Demo | tracing-demo.js |
3008 | Advanced distributed tracing |
| Dashboard Security | example-dashboard-security.js |
3011 | Authentication and authorization |
Purpose: Simplest possible implementation with automatic configuration.
npm run example:one-linerFeatures:
- Automatic async error handling
- Built-in dashboard at
http://localhost:3010/_crashless - Metrics collection
- Request tracking
- Zero configuration required
Port: 3010
Purpose: Minimal setup focusing solely on error handling without telemetry overhead.
npm run example:basicFeatures:
- Error handling only
- No dashboard
- No metrics collection
- Lightweight configuration
Port: 3001
Purpose: Production-ready configuration with security-focused defaults.
npm run example:productionFeatures:
- Message masking for sensitive data
- Stack traces hidden from responses
- Dashboard disabled
- Metrics export available at
/metrics.json
Port: 3002
Purpose: Production deployment with secure dashboard access.
npm run example:production-dashboardWith Security Configuration:
NODE_ENV=production \
DASHBOARD_ALLOWED_IPS="127.0.0.1" \
DASHBOARD_SECRET="your-secret-token" \
npm run example:production-dashboardFeatures:
- Dashboard enabled in production environment
- IP whitelist authentication
- Token-based authentication
- Production-safe defaults
Port: 3000
Purpose: Demonstrates built-in telemetry engine with dashboard and metrics export.
npm run example:builtinFeatures:
- Built-in metrics engine
- Interactive dashboard
- Prometheus export format
- JSON metrics endpoint
Port: 3003
Purpose: Integration with Prometheus monitoring systems.
npm run example:prometheusFeatures:
- Prometheus-compatible metrics endpoint
- Dashboard enabled
- JSON metrics export
- Ready for Prometheus scraping
Port: 3004
Prometheus Configuration Example:
scrape_configs:
- job_name: 'crashless'
static_configs:
- targets: ['localhost:3004']
metrics_path: '/metrics'Purpose: Integration with OpenTelemetry Protocol (OTLP) compatible systems.
npm run example:otelFeatures:
- OpenTelemetry metrics export
- Dashboard enabled
- JSON metrics endpoint
- OTLP-compatible format
Port: 3005
Purpose: Demonstrates custom telemetry exporter implementation.
npm run example:exportersFeatures:
- Custom exporter registration
- Multiple exporters (Sentry, Datadog, custom logger)
- Telemetry callbacks
- Structured logging
Port: 3006
Purpose: Comprehensive demonstration of all available features.
npm run example:fullFeatures:
- All error types demonstration
- Custom errors with contextual details
- Authentication simulation
- Input validation
- Multiple route configurations
- Custom exporters
- Telemetry callbacks
Port: 3007
Purpose: Zero-instrumentation distributed tracing.
npm run example:automatic-tracingFeatures:
- Automatic HTTP request tracing
- Automatic
fetch()tracing - Automatic
fs.readFile()tracing - Dashboard with traces visualization
Port: 3000
Purpose: Advanced distributed tracing with complex async operations.
npm run example:tracingFeatures:
- Complex async operation tracing
- Multiple
fetch()call tracking - Nested operation visualization
- Error tracing
- OTLP export
Port: 3008
Purpose: Comprehensive dashboard security configuration examples.
# Default configuration (localhost allowed)
npm run example:security
# IP whitelist configuration
npm run example:security:ip
# Token authentication
npm run example:security:token
# Production mode with security
npm run example:security:prodFeatures:
- Environment variable-based IP whitelist
- Token authentication
- Custom authentication functions
- Production mode security handling
Port: 3011
Real-time overview of your API's health metrics including total requests, error rate, latency, and uptime. The System tab provides instant visibility without requiring external setup, with automatic updates every few seconds.
Detailed analysis of every endpoint's performance metrics including latency percentiles, status code distribution, and throughput. Quickly identify slow routes or failing APIs at a glance.
Real-time exception tracking with frequency charts and categorized breakdowns. Identify which routes fail most frequently and when error spikes occur.
Monitor new errors in real-time with complete stack traces and timestamps. Ideal for debugging during active traffic or load testing scenarios.
The dashboard automatically adapts to light mode preferences while maintaining clean, fast, and information-dense visualization.
Comprehensive request lifecycle visualization with waterfall traces, including nested database calls, fetch operations, and external API calls. Precisely identify where time is spent from request initiation to completion.
All examples use standard npm install crashless installation and include:
- Proper ES module imports:
import crashless from 'crashless' - Automatic simulation capabilities
- Detailed console logging
- Dashboard and metrics endpoints
- Production-ready configurations
npm run example:one-linerAccess dashboard at http://localhost:3010/_crashless
npm run example:productionMetrics available at http://localhost:3002/metrics.json
NODE_ENV=production \
DASHBOARD_ALLOWED_IPS="127.0.0.1" \
DASHBOARD_SECRET="your-secret-token" \
npm run example:production-dashboardSecure dashboard at http://localhost:3000/_crashless (authentication required)
npm run example:prometheusConfigure Prometheus to scrape from http://localhost:3004/metrics
npm run example:otelOTLP metrics available at http://localhost:3005/metrics/otel
npm run example:exportersMonitor console output for custom exporter data
npm run example:tracingAccess traces at http://localhost:3008/traces.json
- Main Repository: github.com/sunnyghodeswar/crashless
- Documentation: Crashless README
- Security Guide: SECURITY.md
- All examples include automatic simulation capabilities
- Each example runs on a dedicated port to prevent conflicts
- Examples are production-ready and can be adapted for specific use cases
- Comprehensive logging is included in all examples
- Examples run independently and do not require external dependencies beyond Crashless
Sunny Ghodeswar
Built with ❤️ for the Node.js community





