@@ -87,13 +87,13 @@ This package ships a **dual build**: ESM and CommonJS. Node.js picks the right f
8787
8888``` js
8989// ✅ ESM project (type:module or .mjs)
90- import { DiagnosticAgent } from ' argus' ;
90+ import { ArgusAgent } from ' argus' ;
9191
9292// ✅ CommonJS project — require() works directly
93- const { DiagnosticAgent } = require (' argus' );
93+ const { ArgusAgent } = require (' argus' );
9494
9595// ✅ CommonJS project — dynamic import also works
96- const { DiagnosticAgent } = await import (' argus' );
96+ const { ArgusAgent } = await import (' argus' );
9797```
9898
9999---
@@ -109,7 +109,7 @@ npm install argus
109109Then import from the compiled entry point:
110110
111111``` typescript
112- import { DiagnosticAgent } from ' argus' ;
112+ import { ArgusAgent } from ' argus' ;
113113```
114114
115115### Building from source (Node ≥ 22.6, contributors only)
@@ -152,12 +152,12 @@ dist/
152152
153153``` typescript
154154// Compiled npm package
155- import { DiagnosticAgent } from ' argus' ;
155+ import { ArgusAgent } from ' argus' ;
156156
157157// Or if running source directly (Node 22.6+)
158- // import { DiagnosticAgent } from './packages/agent/src/index.ts';
158+ // import { ArgusAgent } from './packages/agent/src/index.ts';
159159
160- const agent = await DiagnosticAgent .createProfile ({
160+ const agent = await ArgusAgent .createProfile ({
161161 environment: ' prod' , // or 'dev' | 'test'
162162 appType: [' web' , ' db' ],
163163}).start ();
@@ -195,7 +195,7 @@ See [`quotes-demo-app/README.md`](quotes-demo-app/README.md) for the full setup
195195` createProfile ` returns a pre-configured builder instance wired for your environment and app type. Call ` .start() ` to initialize all subsystems.
196196
197197``` typescript
198- const agent = await DiagnosticAgent .createProfile ({
198+ const agent = await ArgusAgent .createProfile ({
199199 environment: ' prod' , // 'dev' | 'test' | 'prod'
200200 appType: [' web' , ' db' ], // single string or array — modules are unioned
201201 enabled: true , // overridden by DIAGNOSTIC_AGENT_ENABLED env-var
@@ -227,21 +227,21 @@ Each `.with*()` call is **idempotent** — combining types never double-register
227227
228228``` typescript
229229// Express API + background job runner
230- DiagnosticAgent .createProfile ({ appType: [' web' , ' worker' ] });
230+ ArgusAgent .createProfile ({ appType: [' web' , ' worker' ] });
231231
232232// Worker that queries databases directly
233- DiagnosticAgent .createProfile ({ appType: [' db' , ' worker' ] });
233+ ArgusAgent .createProfile ({ appType: [' db' , ' worker' ] });
234234
235235// Monolith — full coverage
236- DiagnosticAgent .createProfile ({ appType: [' web' , ' db' , ' worker' ] });
236+ ArgusAgent .createProfile ({ appType: [' web' , ' db' , ' worker' ] });
237237```
238238
239239### Auto-Detection
240240
241241Leave ` appType ` unset (or set it to ` 'auto' ` ) and the agent will scan your ` package.json ` dependencies to infer the correct profile:
242242
243243``` typescript
244- const agent = await DiagnosticAgent .createProfile ({
244+ const agent = await ArgusAgent .createProfile ({
245245 environment: ' prod' ,
246246 // appType: 'auto' is the default
247247}).start ();
@@ -252,7 +252,7 @@ const agent = await DiagnosticAgent.createProfile({
252252You can also call the detector standalone:
253253
254254``` typescript
255- const result = DiagnosticAgent .detectAppTypes (' ./my-service' );
255+ const result = ArgusAgent .detectAppTypes (' ./my-service' );
256256// { types: ['web', 'db'], matches: { web: ['express', 'cors'], db: ['pg', 'ioredis'], worker: [] } }
257257```
258258
@@ -274,10 +274,10 @@ const result = DiagnosticAgent.detectAppTypes('./my-service');
274274For maximum control, compose the agent manually using the fluent builder:
275275
276276``` typescript
277- import { DiagnosticAgent } from ' argus' ;
277+ import { ArgusAgent } from ' argus' ;
278278import fs from ' node:fs' ;
279279
280- const agent = await DiagnosticAgent .create ()
280+ const agent = await ArgusAgent .create ()
281281 .withSourceMaps (' ./dist' ) // Source-map resolution for stack traces
282282 .withRuntimeMonitor ({ eventLoopThresholdMs: 50 }) // Event loop lag + memory leak detection
283283 .withInstrumentation ({ autoPatching: true }) // 16 DB drivers via diagnostics_channel
@@ -468,7 +468,7 @@ Requires `.withSourceMaps()`.
468468
469469## Events Reference
470470
471- The agent is an ` EventEmitter ` . All events are emitted on the ` DiagnosticAgent ` instance:
471+ The agent is an ` EventEmitter ` . All events are emitted on the ` ArgusAgent ` instance:
472472
473473| Event | Payload | When |
474474| ---| ---| ---|
@@ -527,7 +527,7 @@ agent.on('pool-exhaustion', (event) => {
527527```
528528
529529> [ !NOTE]
530- > ` DiagnosticAgent ` calls ` setMaxListeners(0) ` internally — you can attach as many listeners as needed without triggering Node's memory leak warning.
530+ > ` ArgusAgent ` calls ` setMaxListeners(0) ` internally — you can attach as many listeners as needed without triggering Node's memory leak warning.
531531
532532---
533533
@@ -557,8 +557,8 @@ All thresholds can be overridden without code changes, making the agent CI/CD an
557557
558558| Method | Prod Safe? | Resource Impact | Description |
559559| ---| ---| ---| ---|
560- | ` DiagnosticAgent .createProfile(config)` | ✅ Yes | N/A | Pre-configured instance from env/app presets |
561- | ` DiagnosticAgent .create()` | ✅ Yes | N/A | Unconfigured fluent builder |
560+ | ` ArgusAgent .createProfile(config)` | ✅ Yes | N/A | Pre-configured instance from env/app presets |
561+ | ` ArgusAgent .create()` | ✅ Yes | N/A | Unconfigured fluent builder |
562562| ` .withSourceMaps(dir?) ` | ✅ Yes | Very Low | Source-map resolution for minified stack traces |
563563| ` .withRuntimeMonitor(opts?) ` | ✅ Yes | Low | Event loop lag + memory leak detection |
564564| ` .withCrashGuard() ` | ✅ Yes | Very Low | Intercepts ` uncaughtException ` ; emits event for ` unhandledRejection ` |
@@ -617,7 +617,7 @@ Telemetry is exported over **mTLS** (Mutual TLS) — both client and server cert
617617
618618```
619619┌──────────────────────────────────────────────────────────────────┐
620- │ DiagnosticAgent │ ← Fluent builder / event bus
620+ │ ArgusAgent │ ← Fluent builder / event bus
621621├──────────────────┬─────────────────────────┬─────────────────────┤
622622│ Profiling │ Instrumentation │ Analysis │
623623│ ──────────────── │ ───────────────────── │ ───────────────── │
@@ -800,7 +800,7 @@ docker compose -f docker-compose.jaeger.yml up -d
800800Then point the agent at it:
801801
802802``` typescript
803- const agent = await DiagnosticAgent .createProfile ({ environment: ' dev' , appType: [' web' , ' db' ] })
803+ const agent = await ArgusAgent .createProfile ({ environment: ' dev' , appType: [' web' , ' db' ] })
804804 .withExporter ({ endpointUrl: ' http://localhost:4318/v1/traces' }) // no TLS needed locally
805805 .start ();
806806```
0 commit comments