datadog-frontend-toolkit 1.0.44 → 1.0.45

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.
Files changed (2) hide show
  1. package/README.md +45 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Enterprise-grade, framework-agnostic frontend observability toolkit for Datadog.
4
4
 
5
- One `init()` call to auto-instrument **RUM**, **Logs**, **Error Tracking**, **Performance Monitoring**, and auto-provision **Dashboards**, **Monitors** & **SLOs** in Datadog.
5
+ One `init()` call to auto-instrument **RUM**, **Logs**, **Error Tracking**, **Performance Monitoring**, and auto-provision **Dashboards**, **Monitors**, **SLOs** & **Burn Rate Alerts** in Datadog.
6
6
 
7
7
  ---
8
8
 
@@ -16,7 +16,10 @@ One `init()` call to auto-instrument **RUM**, **Logs**, **Error Tracking**, **Pe
16
16
  - **Web Vitals tracking** — LCP, CLS, FID, INP, FCP, TTFB with threshold alerts
17
17
  - **Network interception** — monitors XHR/Fetch for failures and slow requests
18
18
  - **PII sanitization** — auto-redacts emails, credit cards, passwords from logs
19
- - **Resource provisioning CLI** — auto-creates Dashboards, Monitors, and SLOs
19
+ - **Resource provisioning CLI** — auto-creates Dashboards, Monitors, SLOs, and Burn Rate Alerts
20
+ - **Environment-aware SLO targets** — 99.5% for production, 95% for non-production
21
+ - **Google SRE burn rate alerts** — multi-window, multi-burn-rate alerting with auto-clamped thresholds
22
+ - **Resource teardown** — `--remove` flag deletes all managed resources for a service/environment
20
23
  - **Plugin system** — extend with custom integrations
21
24
  - **Lifecycle hooks** — `beforeInit`, `afterInit`, `beforeLog`, `beforeError`
22
25
  - **Child loggers** — scoped context for module-specific logging
@@ -315,7 +318,7 @@ init({
315
318
 
316
319
  ## CLI — Resource Provisioning
317
320
 
318
- The CLI provisions Datadog resources (dashboards, monitors, SLOs) for your service automatically with an **interactive wizard**.
321
+ The CLI provisions Datadog resources (dashboards, monitors, SLOs, and burn rate alerts) for your service automatically with an **interactive wizard**.
319
322
 
320
323
  > **Note:** This uses Datadog API/App keys and runs server-side only. Never expose these keys in the browser.
321
324
 
@@ -348,6 +351,20 @@ npx datadog-frontend-toolkit setup -s my-app -e production --force
348
351
  npx datadog-frontend-toolkit setup -s my-app -e production --no-slos
349
352
  ```
350
353
 
354
+ ### Remove Resources
355
+
356
+ Delete all toolkit-managed resources for a given service/environment:
357
+
358
+ ```bash
359
+ # Interactive confirmation before deleting
360
+ npx datadog-frontend-toolkit setup -s my-app -e production --remove
361
+
362
+ # Skip confirmation
363
+ npx datadog-frontend-toolkit setup -s my-app -e production --remove -y
364
+ ```
365
+
366
+ This finds and deletes all monitors, SLOs, burn rate alerts, and dashboards tagged with `managed:datadog-frontend-toolkit` for the specified service and environment.
367
+
351
368
  ### Check Status
352
369
 
353
370
  ```bash
@@ -356,8 +373,8 @@ npx datadog-frontend-toolkit status -s my-app -e production
356
373
 
357
374
  ### What Gets Provisioned
358
375
 
359
- **Dashboard:**
360
- - Frontend Observability overview with RUM metrics, Web Vitals, error tracking, and performance panels
376
+ **Dashboard (1):**
377
+ - Frontend Observability overview with RUM metrics, Web Vitals, error tracking, API endpoint errors, and performance panels
361
378
 
362
379
  **Monitors (6):**
363
380
  - High Frontend Error Rate (>50 errors/5min)
@@ -367,8 +384,23 @@ npx datadog-frontend-toolkit status -s my-app -e production
367
384
  - Error Log Anomaly (>200 error logs/15min)
368
385
  - Poor INP Performance (avg INP > 400ms)
369
386
 
370
- **SLOs (1):**
371
- - Frontend Availability (99.5% target, monitor-based)
387
+ **SLOs (2) — environment-aware targets:**
388
+
389
+ | SLO | Type | Metric | Production | Non-production |
390
+ |-----|------|--------|------------|----------------|
391
+ | Frontend Availability | metric | `view.error_free / view` | 99.5% | 95% |
392
+ | Core Web Vitals (LCP) | time-slice | `p75 LCP < 2.5s` | 75% | 75% |
393
+
394
+ **Burn Rate Alerts (4) — Google SRE multi-window, multi-burn-rate:**
395
+
396
+ For each SLO, two burn rate alert monitors are created:
397
+
398
+ | Alert | Burn Rate | Window | Action |
399
+ |-------|-----------|--------|--------|
400
+ | High Burn Rate | ~14× (budget exhausted in ~2 days) | 1h long / 5m short | 🔥 Investigate immediately |
401
+ | Slow Burn Rate | ~6× (budget exhausted in ~5 days) | 6h long / 30m short | ⚠️ Create ticket, investigate within 24h |
402
+
403
+ > Burn rate thresholds are automatically clamped based on each SLO's target to stay within Datadog's allowed range (`max = 1/(1-target)`).
372
404
 
373
405
  ### Direct Access Links
374
406
 
@@ -381,15 +413,19 @@ After provisioning, the CLI outputs **clickable direct links** to every resource
381
413
  ✅ Monitors:
382
414
  my-app (production) - High Frontend Error Rate
383
415
  https://app.datadoghq.com/monitors/123456789
416
+ my-app (production) - Frontend Availability - High Burn Rate
417
+ https://app.datadoghq.com/monitors/123456790
384
418
  ...
385
419
  ✅ SLOs:
386
420
  my-app (production) - Frontend Availability
387
421
  https://app.datadoghq.com/slo?slo_id=abcdef123456
422
+ my-app (production) - Core Web Vitals (LCP)
423
+ https://app.datadoghq.com/slo?slo_id=abcdef789012
388
424
  ```
389
425
 
390
426
  ### Markdown Summary
391
427
 
392
- A `datadog-observability-{service}.md` file is generated in the current directory with a full summary of all provisioned resources and their direct links. You can commit this to your repo or share it with your team.
428
+ A `datadog-observability-{service}.md` file is generated in the current directory with a full summary of all provisioned resources, descriptions, and direct links. You can commit this to your repo or share it with your team.
393
429
 
394
430
  ### Idempotent Execution
395
431
 
@@ -407,7 +443,7 @@ npx datadog-frontend-toolkit setup -s my-app -e production --force -y
407
443
  This is useful when:
408
444
  - Dashboard templates have been updated with new widgets or sections
409
445
  - Monitor thresholds or queries need to be refreshed
410
- - SLO tags or configurations have changed
446
+ - SLO targets or burn rate configurations have changed
411
447
 
412
448
  ---
413
449
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datadog-frontend-toolkit",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Enterprise-grade, framework-agnostic frontend observability toolkit for Datadog. Auto-instruments RUM, Logs, Error Tracking, Performance Monitoring, and provisions Dashboards, Monitors & SLOs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",