matowatch
v1.4.2
Published
Lightweight monitoring SDK for Matowatch - send heartbeats, logs, errors, metrics, and system profiling from your Node.js app
Downloads
39
Maintainers
Readme
matowatch
Lightweight monitoring SDK for Matowatch - zero-config observability for your Node.js applications.
Install
npm install matowatchQuick Start
const Matowatch = require('matowatch');
Matowatch.init({
apiKey: 'pm_your_api_key_here',
});That's it. Matowatch will automatically:
- Send heartbeat pings every 30s
- Capture uncaught exceptions and unhandled rejections
- Buffer and flush logs efficiently
Logging
Matowatch.info('User signed up', { source: 'auth-service' });
Matowatch.warn('Slow query detected', { metadata: { queryTime: 500 } });
Matowatch.error('Payment failed', { source: 'billing' });Error Capture
try {
await riskyOperation();
} catch (err) {
Matowatch.captureError(err, { source: 'payment-service' });
}Custom Metrics
await Matowatch.metric('response_time', 145, { unit: 'ms', tags: { route: '/api/users' } });
await Matowatch.metric('queue_size', 42, { tags: { queue: 'emails' } });Configuration
Matowatch.init({
apiKey: 'pm_your_api_key',
endpoint: 'https://matowatch.replit.app',
environment: 'production',
heartbeatInterval: 30000,
captureErrors: true,
debug: false,
});Shutdown
Matowatch.shutdown();License
MIT
