Server-Side Tracking
Track API performance, database queries, and custom metrics on your Node.js backend. Full-stack version correlation included.
Request Tracking
Auto-track all HTTP requests with timing, status codes, and route info.
Query Performance
Track database query performance and identify slow queries.
Structured Logging
Send structured logs with levels, metadata, and full context.
Version Correlation
Correlate all events with your backend version and commit hash.
Quick Start
Install
npm install @dwellcount/nodeExpress
import express from 'express';
import { ServerTracker, expressMiddleware } from '@dwellcount/node';
const app = express();
const tracker = new ServerTracker({
siteId: 'YOUR_SITE_ID',
endpoint: 'https://your-dashboard.com/api/ingest',
version: '2.1.0',
commit: process.env.GIT_COMMIT,
});
// Auto-track all requests
app.use(expressMiddleware(tracker));
app.listen(3000);Full-Stack Version Correlation
Dwellcount tracks both frontend and backend versions, letting you correlate all events by version combination. This enables natural A/B testing across deploys.
// Backend sends version headers
app.use((req, res, next) => {
res.setHeader('X-App-Version', process.env.APP_VERSION);
res.setHeader('X-App-Commit', process.env.GIT_COMMIT);
next();
});
// Frontend captures them
const response = await fetch('/api/data');
const version = response.headers.get('X-App-Version');
setBackendVersion({ version });
// Dashboard shows:
// "Frontend v1.2.0 + Backend v2.1.0 = 15% error rate"
// "Frontend v1.2.0 + Backend v2.0.0 = 2% error rate" ← Regression detected!