Skip to content

Releases: codebygarv/ExpressMonitor

v2.8.1 — GitHub Actions Workflow Resilience & NPM/JSR Publication

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 18:17

🎉 Express Lens v2.8.1 is live!

Release Highlights

  • 🤖 GitHub Actions CI Resilience: Added error fallbacks in .github/workflows/publish.yml and .github/workflows/jsr-publish.yml so 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

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 18:14

🎉 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, and maxArrayItems memory 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 /metrics endpoint and sliding window p50/p90/p95/p99 latencies.

v2.7.0 — VitePress Live Documentation Platform & TypeDoc API Reference

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 18:01

🎉 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.yml to build and deploy VitePress docs on every push to main.

v2.6.0 — JSR Registry Publishing (jsr.json)

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 17:52

🎉 Express Lens v2.6.0 is live!

Highlights

  • 🦕 JSR Registry Support: Configured jsr.json to publish @codebygarv/express-lens to 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.yml for automated tag publishing.

v2.5.0 — Stream-Level Body Capture & Smart Truncation

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 17:45

🎉 Express Lens v2.5.0 is live!

Highlights

  • 🌊 Stream-Level Body Capture (src/core/stream.ts): Zero-dependency raw stream payload capture with maxBodySize (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)

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 17:34

🎉 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): withExpressLens HOF for route handlers and dashboardRoute catch-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.ts declaration bundles for all subpath entry points.

v2.3.0 — Native TypeScript Migration & Full Observability Suite

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 16:39

🚀 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 onAlert callbacks when error rates cross X%, memory exceeds Y MB, or latency spikes.
  • 🐢 Slow Request Profiler: Auto-detects and buffers slow requests exceeding slowThresholdMs (default 500ms).
  • 📈 Prometheus Exporter: Standard /metrics endpoint 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

Choose a tag to compare

@codebygarv codebygarv released this 31 Jul 16:01

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 onAlert callbacks 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@latest

Quick 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

Choose a tag to compare

@codebygarv codebygarv released this 26 Jul 05:44

🚀 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.
  • ⚡ Programmatic API (getMetrics):
    • Read application metrics programmatically via getMetrics() or expose a ready-to-use HTTP endpoint via metricsHandler().
  • 🎨 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']).
  • 🧪 Unit Test Suite:
    • Integrated automated test runner suite using node --test.

💻 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

Choose a tag to compare

@codebygarv codebygarv released this 26 Jul 05:32

🚀 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 supported when importing @codebygarv/express-lens in projects using ESM ("type": "module").
    • Converted internal modules (src/system.js, src/store.js, src/middleware.js, index.js) to clean ES Module syntax.
  • Improved Dual CJS & ESM Build Config:
    • Configured tsup with custom entry points and CJS interop to ensure both const monitor = require('@codebygarv/express-lens') and import monitor from '@codebygarv/express-lens' work seamlessly out-of-the-box.
  • Enhanced Documentation & Discoverability:
    • Added a feature comparison section against morgan in README.md.
    • Added comprehensive NPM search keywords (morgan-alternative, logging, express-middleware, apm, observability).

⚡ @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 ⚠️ Partial ✅ Native CJS & ESM (.js & .mjs)

📦 Installation

npm install @codebygarv/[email protected]
# or
yarn add @codebygarv/[email protected]