Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/app-uptime-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
'@bugsee/trackers': minor
---

`environment.app.uptime_s` (whole seconds the process, or for the browser the document, had been running when the capture session started) is now written once at launch on Node, Bun, Deno, Electron main and the browser. It replaces the per-second `process_uptime_s` system trace, which is retired together with the node `ProcessTracker` `uptime` stage.
`environment.app.uptime_s` (whole seconds the process, or for the browser the document, had been running when the capture session started) is now written once at launch on Node, Bun, Electron main and the browser. It replaces the per-second `process_uptime_s` system trace, which is retired together with the node `ProcessTracker` `uptime` stage.
2 changes: 1 addition & 1 deletion .changeset/capture-trace-disk-pressure.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
'@bugsee/electron': minor
---

Disk-pressure protection for the capture stores, on by default where a durable store exists (as on iOS), and a new `capture` system trace. Below 50 MiB free the on-disk (Node, Bun, Deno, Electron main: `statfs` of the data directory every 5 s) or IndexedDB (browser: `navigator.storage.estimate()` headroom, every 5 minutes, every 30 s under 500 MiB) store stops persisting replay, log and network data; below 10 MiB it persists nothing, except the tiny `capture` state record while the state comes from a free-space reading (not while a refused write pins it). The in-memory window is kept either way, so a report built from the live process holds everything the process still has in memory (records waiting for a file that could not be created yet included; with the opt-in worker ring writer, frames still stuck in the ring while the disk is full are not in it) and only a crash loses what was never written (records already on a medium that can no longer be read are not in that report, which is built and delivered anyway). A state is left only 10 MiB above its threshold; a hostile or missing reading never changes the state; a write failing with `QuotaExceededError` / `ENOSPC` (and, for an IndexedDB write, Chromium's `AbortError` / `InvalidStateError`) pins out-of-space until a durable DATA write succeeds again (not until a size reading looks healthy; the probe is a record-sized data write forced past the writer's circuit breaker and backs off so the state cannot flap, and capture resumes within a minute of the disk being freed). `diskProtection: false` opts out. The opt-in `captureDiskSpace` option (canonical key `com.bugsee.option.capture.disk-space`, now shared by the browser and the Node family; the node-only key is gone, the friendly name is unchanged) is only the telemetry: the `capture` trace's `low_disk_space` / `no_disk_space` states and, on Node, `disk_mem_free` / `disk_mem_total`. The `capture` trace (`{state}`: `active`, `blackout`, `low_disk_space`, `no_disk_space`) is written by the browser while its rrweb recorder runs and by Electron main while pixel video runs; never by Node, Bun, Deno, WebViews, Electron renderers or a launch with `replay: false`. Fixes in the batched fs writer: `read()` includes the buffered tail of a failed flush and a chunk seal no longer drops it; the off-thread ring writer reports drain failures instead of swallowing them; a `statfs` that hangs holds one read and starts no more; a durable snapshot or drain that throws synchronously, or a read that overruns, never fails a report (the in-memory records are served, once-per-streak report, and a slow healthy read ends the degraded state); the batched writer decodes `read()` once across the disk/tail boundary and keeps records of a file it cannot create yet; a short write followed by a failure no longer duplicates data in the ring writer; the IndexedDB store keeps records not yet written (queued or refused) in memory and serves them when the database cannot be read, reopens a closed connection, and times out and releases a read that never answers; the disk-pressure probe is a synchronous write of padding into a file of its own in the part just opened (never queued as a ring frame, never a part of its own), so it leaves no directory, descriptor or late write behind, and a host-side failure of the ring writer can be recovered from. `@bugsee/replay` recorders gain `checkout()` (a fresh full snapshot, used when persistence resumes). New `@bugsee/core` exports: `createDiskPressure`, `withDiskPressure`, `DiskPressureToken`, `isOutOfSpaceError`, the threshold constants, and `diskPressure` / `onDiskWriteError` options on the chunk, file and IndexedDB stores.
Disk-pressure protection for the capture stores, on by default where a durable store exists (as on iOS), and a new `capture` system trace. Below 50 MiB free the on-disk (Node, Bun, Electron main: `statfs` of the data directory every 5 s) or IndexedDB (browser: `navigator.storage.estimate()` headroom, every 5 minutes, every 30 s under 500 MiB) store stops persisting replay, log and network data; below 10 MiB it persists nothing, except the tiny `capture` state record while the state comes from a free-space reading (not while a refused write pins it). The in-memory window is kept either way, so a report built from the live process holds everything the process still has in memory (records waiting for a file that could not be created yet included; with the opt-in worker ring writer, frames still stuck in the ring while the disk is full are not in it) and only a crash loses what was never written (records already on a medium that can no longer be read are not in that report, which is built and delivered anyway). A state is left only 10 MiB above its threshold; a hostile or missing reading never changes the state; a write failing with `QuotaExceededError` / `ENOSPC` (and, for an IndexedDB write, Chromium's `AbortError` / `InvalidStateError`) pins out-of-space until a durable DATA write succeeds again (not until a size reading looks healthy; the probe is a record-sized data write forced past the writer's circuit breaker and backs off so the state cannot flap, and capture resumes within a minute of the disk being freed). `diskProtection: false` opts out. The opt-in `captureDiskSpace` option (canonical key `com.bugsee.option.capture.disk-space`, now shared by the browser and the Node family; the node-only key is gone, the friendly name is unchanged) is only the telemetry: the `capture` trace's `low_disk_space` / `no_disk_space` states and, on Node, `disk_mem_free` / `disk_mem_total`. The `capture` trace (`{state}`: `active`, `blackout`, `low_disk_space`, `no_disk_space`) is written by the browser while its rrweb recorder runs and by Electron main while pixel video runs; never by Node, Bun, WebViews, Electron renderers or a launch with `replay: false`. Fixes in the batched fs writer: `read()` includes the buffered tail of a failed flush and a chunk seal no longer drops it; the off-thread ring writer reports drain failures instead of swallowing them; a `statfs` that hangs holds one read and starts no more; a durable snapshot or drain that throws synchronously, or a read that overruns, never fails a report (the in-memory records are served, once-per-streak report, and a slow healthy read ends the degraded state); the batched writer decodes `read()` once across the disk/tail boundary and keeps records of a file it cannot create yet; a short write followed by a failure no longer duplicates data in the ring writer; the IndexedDB store keeps records not yet written (queued or refused) in memory and serves them when the database cannot be read, reopens a closed connection, and times out and releases a read that never answers; the disk-pressure probe is a synchronous write of padding into a file of its own in the part just opened (never queued as a ring frame, never a part of its own), so it leaves no directory, descriptor or late write behind, and a host-side failure of the ring writer can be recovered from. `@bugsee/replay` recorders gain `checkout()` (a fresh full snapshot, used when persistence resumes). New `@bugsee/core` exports: `createDiskPressure`, `withDiskPressure`, `DiskPressureToken`, `isOutOfSpaceError`, the threshold constants, and `diskPressure` / `onDiskWriteError` options on the chunk, file and IndexedDB stores.
3 changes: 1 addition & 2 deletions .changeset/delete-legacy-node-samplers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
'@bugsee/node': minor
'@bugsee/bun': minor
'@bugsee/deno': minor
---

Removed the legacy `createNodeSystemMetricsSampler` and `createGuardedSystemMetricsSampler` (and their `NodeSystemMetricsDeps` / `GuardedSystemMetricsDeps` types). Nothing in the SDK used them; node, Bun and Deno already build their system traces from `createNodeSystemTraceProducers`. A caller-supplied `systemMetricsSampler` option still works, and `PerfHooks` is still exported.
Removed the legacy `createNodeSystemMetricsSampler` and `createGuardedSystemMetricsSampler` (and their `NodeSystemMetricsDeps` / `GuardedSystemMetricsDeps` types). Nothing in the SDK used them; node and Bun already build their system traces from `createNodeSystemTraceProducers`. A caller-supplied `systemMetricsSampler` option still works, and `PerfHooks` is still exported.
7 changes: 7 additions & 0 deletions .changeset/drop-deno-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@bugsee/bugsee': minor
'@bugsee/util': minor
'@bugsee/trackers': minor
---

**Deno is no longer supported.** `@bugsee/deno` is removed (deprecate the published versions on npm; use Node.js, Bun or a browser). The `@bugsee/bugsee` umbrella keeps its `deno` export condition and `./deno` subpath only so that importing it on Deno throws a clear "Deno is no longer supported" error instead of silently resolving the Node build, which misreports the runtime, leaves `Deno.serve` uninstrumented and can freeze the process when local-variable capture is on. `isDeno` is removed from `@bugsee/util` (`isNode()` no longer excludes Deno). `@bugsee/trackers/node` no longer exports `createDenoMemoryReader`, `createDenoExecFile` or `denoVmStatGranted`, and `createVmStatSampler` no longer accepts `canSpawn` (it existed only for Deno's `run` permission). The protocol `RuntimeType` still includes `'deno'` so existing reports stay valid.
7 changes: 3 additions & 4 deletions .changeset/gc-event-and-elu-percent.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
'@bugsee/node': minor
'@bugsee/bun': minor
'@bugsee/deno': minor
'@bugsee/electron': minor
'@bugsee/trackers': minor
---

System traces are unified with Android/iOS (C15, C16). None of this has been released before, so there is no migration.

- `event_loop_utilization` is a PERCENT 0-100 with one decimal (`60` is "60% busy"), consistent with `cpu_usage_process`, not a `0..1` fraction. Bun and Deno still omit it (their `eventLoopUtilization()` answers flat zeros). The ProcessTracker `utilization` stage payload is now `{ utilizationPercent }` instead of `{ utilization }`, and an injected `eventLoopUtilization` reader must answer percent.
- `event_loop_utilization` is a PERCENT 0-100 with one decimal (`60` is "60% busy"), consistent with `cpu_usage_process`, not a `0..1` fraction. Bun still omits it (its `eventLoopUtilization()` answers flat zeros). The ProcessTracker `utilization` stage payload is now `{ utilizationPercent }` instead of `{ utilization }`, and an injected `eventLoopUtilization` reader must answer percent.
- **No gc traces:** `gc_count`, `gc_pause_ms` and `gc_pause_max_ms` are not written to `traces.system`.
- **New event:** garbage collection is the `gc` event in `events.system`, params `{ count, pauseMs, maxPauseMs }` (pauses rounded to 3 decimals). One event is written per 1 s interval in which at least one collection ran; a quiet interval writes nothing. Node and Electron main only: Bun and Deno never emit it (their GC observer is blind). The observer exists only while system events are captured (`captureSystemEvents`). `createNodeSystemEventsSource` gains `processTracker` and `onError` options.
- **Timers:** the GC observer and its share of the 1 s tracker sampling timer now belong to system events, so `captureSystemTraces: false` alone no longer means no sampling timer on Node (set `captureSystemEvents: false` too). A tracker stage the runtime can never answer (Bun/Deno gates) no longer keeps that timer alive.
- **New event:** garbage collection is the `gc` event in `events.system`, params `{ count, pauseMs, maxPauseMs }` (pauses rounded to 3 decimals). One event is written per 1 s interval in which at least one collection ran; a quiet interval writes nothing. Node and Electron main only: Bun never emits it (its GC observer is blind). The observer exists only while system events are captured (`captureSystemEvents`). `createNodeSystemEventsSource` gains `processTracker` and `onError` options.
- **Timers:** the GC observer and its share of the 1 s tracker sampling timer now belong to system events, so `captureSystemTraces: false` alone no longer means no sampling timer on Node (set `captureSystemEvents: false` too). A tracker stage the runtime can never answer (Bun gates) no longer keeps that timer alive.
3 changes: 1 addition & 2 deletions .changeset/memory-limit-gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
'@bugsee/trackers': minor
'@bugsee/node': minor
'@bugsee/bun': minor
'@bugsee/deno': minor
---

`process_memory_limit` now has an explicit runtime gate, `measuresConstrainedMemory` (default on). Bun and Deno enable it only on Linux, the one platform where a cgroup cap exists, so the trace is omitted elsewhere instead of relying on the value filter alone.
`process_memory_limit` now has an explicit runtime gate, `measuresConstrainedMemory` (default on). Bun enables it only on Linux, the one platform where a cgroup cap exists, so the trace is omitted elsewhere instead of relying on the value filter alone.
1 change: 0 additions & 1 deletion .changeset/node-disk-space.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
'@bugsee/node': minor
'@bugsee/bun': minor
'@bugsee/deno': minor
---

New opt-in `captureDiskSpace` option: reports `disk_mem_free` and `disk_mem_total` (integer binary MB, Android parity) in `traces.system` for the filesystem the SDK's data directory lives on, polled every 5 s off the event loop (not held, so a failing statfs leaves a gap rather than a stale value). It is omitted when there is no data directory (in-memory or degraded launch) rather than falling back to `/` or the working directory, and when a reading is not sane rather than reported as 0. Default off.
3 changes: 1 addition & 2 deletions .changeset/node-process-tracker.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
'@bugsee/node': minor
'@bugsee/bun': minor
'@bugsee/deno': minor
'@bugsee/trackers': minor
---

Node, Bun and Deno system traces now come from a per-process `ProcessTracker` in the new `@bugsee/trackers/node` entry, which replaces `@bugsee/node`'s `ProcessStatsTracker`. Trace names are unchanged, the GC observer and event-loop histogram now run only while their traces are enabled, and the runtime gates for Bun and Deno still omit the traces those runtimes cannot measure honestly. The `cpu_usage_*` traces no longer record a start value (it was a microsecond-window noise reading); they begin with the first sample. `@bugsee/node` (and so `@bugsee/bun` and `@bugsee/deno`, which re-export it) no longer exports `ProcessStatsTracker` and `ProcessStats`; it exports `processTrackerFor`, `resetProcessTracker` and the `ProcessTracker` type instead.
Node and Bun system traces now come from a per-process `ProcessTracker` in the new `@bugsee/trackers/node` entry, which replaces `@bugsee/node`'s `ProcessStatsTracker`. Trace names are unchanged, the GC observer and event-loop histogram now run only while their traces are enabled, and the runtime gates for Bun still omit the traces those runtimes cannot measure honestly. The `cpu_usage_*` traces no longer record a start value (it was a microsecond-window noise reading); they begin with the first sample. `@bugsee/node` (and so `@bugsee/bun`, which re-exports it) no longer exports `ProcessStatsTracker` and `ProcessStats`; it exports `processTrackerFor`, `resetProcessTracker` and the `ProcessTracker` type instead.
5 changes: 2 additions & 3 deletions .changeset/node-runtime-traces.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
'@bugsee/node': minor
'@bugsee/bun': minor
'@bugsee/deno': minor
---

Node, Bun and Deno now report more runtime traces in `traces.system`:
Node and Bun now report more runtime traces in `traces.system`:

- `v8_heap_size_limit`, `v8_heap_available`, `v8_heap_malloced`, `v8_heap_peak_malloced` and the ceiling-based `ram_js_heap_total` / `_used` / `_free` (`total` is the heap limit, not the committed heap). Node and Deno only; omitted on Bun, whose heap statistics are not a V8 ceiling.
- `v8_heap_size_limit`, `v8_heap_available`, `v8_heap_malloced`, `v8_heap_peak_malloced` and the ceiling-based `ram_js_heap_total` / `_used` / `_free` (`total` is the heap limit, not the committed heap). Node only; omitted on Bun, whose heap statistics are not a V8 ceiling.
- `process_memory_limit` (the cgroup cap), reported only for a real cap: omitted when `process.constrainedMemory()` is 0, the 2^64 sentinel, or at least total RAM.

`createNodeSystemTraceProducers` gains `measuresV8Heap` (default `true`) for runtimes that cannot answer honestly.
3 changes: 1 addition & 2 deletions .changeset/node-storage-tracker.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
'@bugsee/node': minor
'@bugsee/bun': minor
'@bugsee/deno': minor
'@bugsee/trackers': minor
---

The opt-in `captureDiskSpace` traces (`disk_mem_free`, `disk_mem_total`) now come from a per-process `StorageTracker` in the `@bugsee/trackers/node` entry, which takes over the statfs read and its poll from `@bugsee/node`. Trace names, integer-MB wire values, the 5 s cadence and the opt-in behaviour are unchanged: the tracker polls only while the producer is subscribed, reports a failing read once per failure streak, and omits an unreadable or unsane reading instead of reporting a zero. The tracker is shared per data directory: launches over the same directory share one (its `onError` and scheduler are latest-launch-wins), launches over different directories each keep polling their own directory and reporting to their own `onError`. `@bugsee/node` (and so `@bugsee/bun` and `@bugsee/deno`, which re-export it) also exports `storageTrackerFor`, `resetStorageTracker` and the `StorageTracker` type.
The opt-in `captureDiskSpace` traces (`disk_mem_free`, `disk_mem_total`) now come from a per-process `StorageTracker` in the `@bugsee/trackers/node` entry, which takes over the statfs read and its poll from `@bugsee/node`. Trace names, integer-MB wire values, the 5 s cadence and the opt-in behaviour are unchanged: the tracker polls only while the producer is subscribed, reports a failing read once per failure streak, and omits an unreadable or unsane reading instead of reporting a zero. The tracker is shared per data directory: launches over the same directory share one (its `onError` and scheduler are latest-launch-wins), launches over different directories each keep polling their own directory and reporting to their own `onError`. `@bugsee/node` (and so `@bugsee/bun`, which re-exports it) also exports `storageTrackerFor`, `resetStorageTracker` and the `StorageTracker` type.
5 changes: 2 additions & 3 deletions .changeset/omit-unavailable-elu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@

Event-loop utilization is now omitted on runtimes that cannot measure it, instead of reported as 0%.

`performance.eventLoopUtilization()` exists on Bun and Deno and does not throw — it simply answers
`performance.eventLoopUtilization()` exists on Bun and does not throw — it simply answers
`{idle: 0, active: 0, utilization: 0}` for ever. The SDK's guard only caught *throws*, so every sample
carried a confident 0%, which reads exactly like a perfectly healthy idle process to whoever opens the
report. Measured after a 120 ms CPU burn plus a 60 ms sleep:

```
node {"idle":61.0,"active":0.118,"utilization":0.0019}
bun {"idle":0,"active":0,"utilization":0}
deno {"idle":0,"active":0,"utilization":0}
```

The `event_loop_utilization` trace is now absent on Bun and Deno and unchanged on Node. The
The `event_loop_utilization` trace is now absent on Bun and unchanged on Node. The
discriminator is `idle`, not `utilization`: idle accumulates wall-clock time between samples on any
honest implementation, so it cannot be zero at the sampler's 1 s cadence — while a process that
genuinely did nothing reports utilization 0 with a non-zero idle, and that reading is true and kept.
Expand Down
Loading