server-devtools 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  **Chrome DevTools for your backend.**
4
4
 
5
5
  ServerDevTools is an embeddable backend inspector for Node.js
6
- applications.
6
+ applications: **Chrome DevTools for your Node.js backend.**
7
7
 
8
8
  It gives you a live dashboard for inspecting:
9
9
 
@@ -16,6 +16,9 @@ It gives you a live dashboard for inspecting:
16
16
  - database operations
17
17
  - errors
18
18
  - timing
19
+ - current/authenticated user context
20
+ - server-side request search
21
+ - request filtering by HTTP method and status
19
22
 
20
23
  Instead of jumping between logs, traces, and multiple observability
21
24
  tools, ServerDevTools lets you inspect what your backend is doing from
@@ -83,6 +86,9 @@ full production observability platforms.
83
86
  npm install server-devtools
84
87
  ```
85
88
 
89
+ ServerDevTools includes the supported OpenTelemetry instrumentation libraries;
90
+ you do not need to install the database instrumentation packages separately.
91
+
86
92
  ------------------------------------------------------------------------
87
93
 
88
94
  ## Quick Start
@@ -159,6 +165,18 @@ server.listen(3000);
159
165
  tsx watch --import ./server-devtools.ts src/main.ts
160
166
  ```
161
167
 
168
+ `await devtools.start()` automatically registers OpenTelemetry's ESM loader hook
169
+ once per process before starting the OpenTelemetry SDK. Keep startup in the
170
+ preload module and let it complete before application dependencies load, including
171
+ normal Redis (ioredis) imports. Already-loaded dependencies cannot be instrumented
172
+ retroactively.
173
+
174
+ The installed OpenTelemetry hook exports asynchronous loader hooks, which require
175
+ `node:module.register()`. Newer Node.js versions deprecate this API; its
176
+ `registerHooks()` replacement takes synchronous hooks and cannot directly load
177
+ OpenTelemetry's `hook.mjs`. This compatibility requirement does not change the
178
+ startup command or configuration.
179
+
162
180
  The application can import the same instance normally and mount it in Express:
163
181
 
164
182
  ```ts
@@ -440,16 +458,33 @@ http://localhost:3000
440
458
 
441
459
  ## Current Support
442
460
 
443
- Initial support focuses on Node.js applications:
461
+ ServerDevTools currently supports:
444
462
 
445
- - Node.js HTTP
463
+ - Node.js
446
464
  - Express
447
465
  - NestJS middleware and error interception
448
- - MongoDB operations
466
+ - MongoDB
467
+ - PostgreSQL through `pg`
468
+ - MySQL through `mysql2`
469
+ - Redis (ioredis)
449
470
  - native HTTP/HTTPS and fetch/Undici requests, including headers and bodies
471
+ - request search and filtering by HTTP method and status
472
+ - current/authenticated user context when supplied by the application
450
473
  - OpenTelemetry-powered activity capture
451
474
 
452
- Support will expand as the project develops.
475
+ ### Database tracing
476
+
477
+ Supported database operations automatically appear inside the request
478
+ execution trace when using these supported drivers:
479
+
480
+ - MongoDB
481
+ - PostgreSQL (`pg`)
482
+ - MySQL (`mysql2`)
483
+ - Redis (ioredis)
484
+
485
+ Redis command spans include command inspection, arguments, timings, request
486
+ links, and command errors. Redis (ioredis) support has been verified in
487
+ Express and NestJS applications, including pipelines and transactions.
453
488
 
454
489
  ------------------------------------------------------------------------
455
490
 
@@ -486,40 +521,12 @@ Expect APIs and configuration to evolve before `1.0`.
486
521
 
487
522
  ------------------------------------------------------------------------
488
523
 
489
- ## Roadmap
490
-
491
- Near-term:
492
-
493
- - [x] HTTP request capture
494
- - [x] Request headers
495
- - [x] Query parameters
496
- - [x] Route parameters
497
- - [x] Request body
498
- - [x] HTTP response status
499
- - [x] Response headers
500
- - [x] Response body
501
- - [x] Execution tree
502
- - [x] Native HTTP/HTTPS and fetch/Undici inspection
503
- - [x] MongoDB inspection
504
- - [x] Error inspection
505
- - [x] NestJS integration and error interception
506
- - [x] Encryption at rest for selected fields
507
- - [ ] Request/response redaction
508
- - [ ] Body-size limits
509
- - [ ] Production-safe configuration
510
- - [ ] Broader NestJS compatibility
511
- - [x] Static dashboard packaging
512
-
513
- Future ideas:
514
-
515
- - Redis
516
- - PostgreSQL
517
- - MySQL
518
- - additional Node frameworks
519
- - trace filtering
520
- - request search
521
- - configurable retention
522
- - multi-instance support
524
+ ## Coming next
525
+
526
+ Planned, not yet available:
527
+
528
+ - Configurable trace storage, including storing ServerDevTools data through
529
+ user-configured storage instead of only the default local SQLite storage
523
530
 
524
531
  ------------------------------------------------------------------------
525
532
 
@@ -558,6 +565,19 @@ The goal is simple:
558
565
 
559
566
  The project is still early.
560
567
 
568
+ ### Redis (ioredis) integration tests
569
+
570
+ The ioredis integration tests require a disposable Redis instance. Run
571
+ them with its connection URL:
572
+
573
+ ```sh
574
+ REDIS_TEST_URL=redis://127.0.0.1:6379 npx tsx --test tests/ioredis-integration.test.ts
575
+ ```
576
+
577
+ When `REDIS_TEST_URL` is not set, the Redis integration tests are
578
+ reported as skipped. The tests use isolated keys and clean up their
579
+ clients and data.
580
+
561
581
  Issues, ideas, bug reports, and contributions are welcome.
562
582
 
563
583
  ------------------------------------------------------------------------