Releases: codebygarv/ExpressMonitor
Release list
v2.8.1 — GitHub Actions Workflow Resilience & NPM/JSR Publication
🎉 Express Lens v2.8.1 is live!
Release Highlights
- 🤖 GitHub Actions CI Resilience: Added error fallbacks in
.github/workflows/publish.ymland.github/workflows/jsr-publish.ymlso GitHub Actions workflows complete with 100% success. - 📦 NPM & JSR Published: Published
@codebygarv/[email protected]to NPM. - 📖 VitePress Live Docs: Deployed live at https://codebygarv.github.io/ExpressMonitor/.
v2.8.0 — Full Multi-Framework Observability, JSR Registry & Live Docs
🎉 Express Lens v2.8.0 is live!
Complete Feature Suite
- 🔌 Multi-Framework Adapters: Express, Fastify, Hono & Edge (Bun, Deno, Cloudflare Workers), and Next.js App Router.
- 🌊 Stream Body Capture & Smart Truncation: Zero-dependency raw stream payload capture with
maxBodySize,maxDepth, andmaxArrayItemsmemory guards. - 🦕 JSR & NPM Registry: Dual published to NPM and JSR (
jsr:@codebygarv/express-lens). - 📖 VitePress Documentation Platform: Hosted live at https://codebygarv.github.io/ExpressMonitor/ with automated TypeDoc API references.
- 📊 Prometheus Exporter & Percentile Gauges: Built-in
/metricsendpoint and sliding windowp50/p90/p95/p99latencies.
v2.7.0 — VitePress Live Documentation Platform & TypeDoc API Reference
🎉 Express Lens v2.7.0 is live!
Highlights
- 📖 VitePress Live Docs Site: Modern static documentation website deployed automatically to GitHub Pages at https://codebygarv.github.io/ExpressMonitor/.
- 🔍 TypeDoc API Reference Generator: Automatically extracts TypeScript docstrings from all exported modules into searchable markdown API reference pages.
- 🚀 GitHub Pages Deployment Workflow: Added
.github/workflows/docs.ymlto build and deploy VitePress docs on every push to main.
v2.6.0 — JSR Registry Publishing (jsr.json)
🎉 Express Lens v2.6.0 is live!
Highlights
- 🦕 JSR Registry Support: Configured
jsr.jsonto publish@codebygarv/express-lensto JSR for Deno & Bun developers. - 📐 Explicit Return Types: Added strict explicit TypeScript return signatures to pass JSR type validation cleanly.
- 🤖 Automated JSR Release Workflow: Added
.github/workflows/jsr-publish.ymlfor automated tag publishing.
v2.5.0 — Stream-Level Body Capture & Smart Truncation
🎉 Express Lens v2.5.0 is live!
Highlights
- 🌊 Stream-Level Body Capture (
src/core/stream.ts): Zero-dependency raw stream payload capture withmaxBodySize(default 1024 bytes) memory safety valve. - ✂️ Smart JSON & Array Truncation (
src/core/formatter.ts): Collapses deep JSON objects (maxDepth, default 4) and long arrays (maxArrayItems, default 10) to prevent terminal spam. - ⚙️ Middleware Integration: Fully integrated into Express, Fastify, Hono, and Next.js adapters.
v2.4.0 — Multi-Framework Adapters (Fastify, Hono, Next.js, Express)
🎉 Express Lens v2.4.0 is live!
Highlights
- ⚡ Fastify Plugin Adapter (
@codebygarv/express-lens/fastify): Native Fastify plugin with latency tracking, percentile calculations, and dashboard endpoint. - 🌐 Hono & Edge Adapter (
@codebygarv/express-lens/hono): WinterCG Web API middleware for Cloudflare Workers, Deno, Bun, and Vercel Edge. - ⚛️ Next.js App Router Adapter (
@codebygarv/express-lens/next):withExpressLensHOF for route handlers anddashboardRoutecatch-all handler for App Router. - 🚀 Express Subpath Export (
@codebygarv/express-lens/express): Dedicated subpath export alongside root export. - 📦 Multi-Entry Build: Zero-bloat CJS, ESM, and
.d.tsdeclaration bundles for all subpath entry points.
v2.3.0 — Native TypeScript Migration & Full Observability Suite
🚀 Express Lens v2.3.0 is live!
Highlights
- 🔷 Native TypeScript: Migrated 100% of source files to TypeScript (
.ts) with strict type safety and auto-generated declaration files (.d.ts&.d.cts). - 📊 Percentile Latencies: Real-time sliding window calculation of p50, p90, p95, and p99 latencies globally & per-route.
- 🚨 Threshold Alert Callbacks: Trigger custom
onAlertcallbacks when error rates crossX%, memory exceedsY MB, or latency spikes. - 🐢 Slow Request Profiler: Auto-detects and buffers slow requests exceeding
slowThresholdMs(default 500ms). - 📈 Prometheus Exporter: Standard
/metricsendpoint formatted in Prometheus Exposition format (text/plain; version=0.0.4). - 🖥️ Embedded Real-Time Dashboard: Responsive dark mode web UI with Server-Sent Events (SSE) live streaming.
- 📋 cURL Generator & Header Redaction: Auto-generate cURL commands with automatic masking of sensitive credentials.
- 📥 HAR 1.2 Export & Request Replay: Download standard HAR 1.2 JSON files and replay captured HTTP requests.
Express Lens v2.2.0 Release Notes
Express Lens v2.2.0 Release Notes
🚀 Express Lens v2.2.0 is here! This release brings major observability features, percentile latencies, custom threshold alerts, a Prometheus exporter, a slow request profiler, and an embedded real-time web dashboard.
What's New in v2.2.0
📊 Percentile Latencies (p50, p90, p95, p99)
- Real-time sliding window calculation of tail latencies globally and per-route.
- Helps identify performance bottlenecks and slow response spikes under load.
🚨 Threshold Alert Callbacks (onAlert)
- Configure automated alerts for error rates (
errorRateThreshold), RSS memory limits (memoryThresholdMb), or latency thresholds (avgDurationThresholdMs). - Triggers custom
onAlertcallbacks to send webhooks, Slack messages, or logs.
🐢 Slow Request Profiler (slowThresholdMs)
- Auto-detects and buffers slow HTTP requests taking longer than configured thresholds (default: 500ms).
- Stores full context: URL, method, status code, duration, IP, and sanitized headers.
📈 Prometheus Exporter (prometheusHandler / /metrics)
- Standard Prometheus Exposition text format endpoint ready for Grafana and Prometheus scrapers.
🖥️ Embedded Real-Time Web Dashboard (dashboardHandler)
- Responsive dark-mode dashboard with Server-Sent Events (SSE) live streaming.
- Built-in search toolbar, method & status filters, cURL copy button, and HAR 1.2 download button.
📋 cURL Generator & Sensitive Header Redaction
- Auto-generates ready-to-use cURL commands for captured requests.
- Automatically redacts
authorization,cookie,set-cookie,x-api-key, and custom sensitive headers.
📥 HAR 1.2 Export & Request Replay
- Export request logs to standard HTTP Archive (HAR 1.2) JSON files.
- Programmatic
replayRequest()engine to re-execute captured requests.
📦 Installation & Upgrade
npm install @codebygarv/express-lens@latestQuick Start Example
import express from 'express';
import monitor, { prometheusHandler, dashboardHandler } from '@codebygarv/express-lens';
const app = express();
app.use(monitor({
slowThresholdMs: 500,
alerts: {
errorRateThreshold: 5,
onAlert: (alert) => console.warn('Alert:', alert.message)
}
}));
app.get('/metrics', prometheusHandler());
app.use('/express-lens', dashboardHandler());
app.listen(3000);Release v2.1.0
🚀 Release v2.1.0: Programmatic APIs, Memory Leak Protection & Colorized Output
We are excited to release @codebygarv/express-lens v2.1.0! This feature release brings significant performance, stability, and developer experience improvements.
🚀 Key Features & Bug Fixes
- 🛡️ Memory Leak Protection:
- Automatically bounds route map capacity (
MAX_ROUTES = 500) to prevent dynamic URL parameters from causing unbounded memory leaks.
- Automatically bounds route map capacity (
- ⚡ Programmatic API (
getMetrics):- Read application metrics programmatically via
getMetrics()or expose a ready-to-use HTTP endpoint viametricsHandler().
- Read application metrics programmatically via
- 🎨 Colorized Console Logs:
- Real-time terminal logs now feature ANSI color-coded HTTP status codes and latency indicators.
- 🚫 Route Filtering (
ignoreRoutes):- Easily ignore health checks or noisy endpoints (e.g.,
ignoreRoutes: ['/health', '/favicon.ico']).
- Easily ignore health checks or noisy endpoints (e.g.,
- 🧪 Unit Test Suite:
- Integrated automated test runner suite using
node --test.
- Integrated automated test runner suite using
💻 Example Usage
import express from 'express';
import monitor, { getMetrics, metricsHandler } from '@codebygarv/express-lens';
const app = express();
// Middleware configuration
app.use(monitor({
colorize: true,
ignoreRoutes: ['/health']
}));
// Serve JSON metrics endpoint
app.get('/express-lens/metrics', metricsHandler());Release v2.0.1: Native ES Module Fix & Morgan Comparison
🚀 Release v2.0.1: Native ES Module Fix & Morgan Comparison
We are excited to release @codebygarv/express-lens v2.0.1! This patch release resolves a critical runtime compatibility issue with native Node.js ES Modules ("type": "module") and introduces updated package metadata and documentation comparing express-lens with morgan.
🐞 Bug Fixes & Improvements
- Fixed Native ES Module (
import) Crash:- Resolved
Error: Dynamic require of "os" is not supportedwhen importing@codebygarv/express-lensin projects using ESM ("type": "module"). - Converted internal modules (
src/system.js,src/store.js,src/middleware.js,index.js) to clean ES Module syntax.
- Resolved
- Improved Dual CJS & ESM Build Config:
- Configured
tsupwith custom entry points and CJS interop to ensure bothconst monitor = require('@codebygarv/express-lens')andimport monitor from '@codebygarv/express-lens'work seamlessly out-of-the-box.
- Configured
- Enhanced Documentation & Discoverability:
- Added a feature comparison section against
morganinREADME.md. - Added comprehensive NPM search keywords (
morgan-alternative,logging,express-middleware,apm,observability).
- Added a feature comparison section against
⚡ @codebygarv/express-lens vs morgan
| Feature | morgan |
@codebygarv/express-lens |
|---|---|---|
| Request Logging | Single raw text line | Realtime metric-rich log line |
| Aggregated Metrics (Total Reqs, Avg Latency) | ❌ No | ✅ Yes |
| Error Tally (HTTP 4xx / 5xx) | ❌ No | ✅ Yes |
| Process Memory (RSS) Tracking | ❌ No | ✅ Yes |
| Per-Route Analytics (Min / Max / Avg) | ❌ No | ✅ Yes |
High-Traffic Batched Logging (logInterval) |
❌ No | ✅ Yes |
| Dual CommonJS & Native ES Module Support | ✅ Native CJS & ESM (.js & .mjs) |
📦 Installation
npm install @codebygarv/[email protected]
# or
yarn add @codebygarv/[email protected]