openspec: propose SBMD runtime observability instrumentation#245
openspec: propose SBMD runtime observability instrumentation#245rchowdcmcsa wants to merge 26 commits into
Conversation
Add change proposal, design, spec, and task list for wiring the existing observability API into the SBMDv4 JS runtime. Metrics defined: - JS heap pool health (used, free, arena, peak, free blocks) via periodic background sampler in MQuickJsRuntime - Per-invocation handler duration, heap delta, and outcome (success/exception/timeout/stack_overflow/error) via SbmdHandlerInvoker::InvokeHandler - JS mutex wait time per handler invocation path - Driver load cost (duration, heap bytes) and failure counts per driver and failure reason - Registered driver count at startup - Deferred operation lifecycle: in-flight gauge, total duration, deferral depth, timeout count, max-depth-exceeded count; all attributed by driver and originating op type via new origOpType field on PendingOperation - JS exception events (init and loading phases only) All metrics are centralized in a new SbmdMetrics class. GC tracking is deferred to a follow-on change.
There was a problem hiding this comment.
Pull request overview
Adds an OpenSpec change proposal defining a concrete SBMDv4 runtime observability plan (metrics set, instrumentation points, and a work breakdown) to wire the existing in-tree observability API into the SBMD JS runtime.
Changes:
- Introduces a new
sbmd-runtime-observabilityspec defining metric names, instruments, attributes, and required behaviors. - Adds design/proposal docs describing the intended C++ integration points (runtime sampler, handler invocation metering, driver load metering, deferred-op lifecycle metrics).
- Adds an implementation task list covering C++ wiring, new unit tests, and integration tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| openspec/changes/sbmd-observability-instrumentation/proposal.md | High-level motivation/scope and intended code touchpoints for SBMD runtime instrumentation. |
| openspec/changes/sbmd-observability-instrumentation/design.md | Detailed design decisions for where/how metrics will be captured and attributed. |
| openspec/changes/sbmd-observability-instrumentation/specs/sbmd-runtime-observability/spec.md | Normative requirements for the SBMD runtime metrics (names, semantics, scenarios). |
| openspec/changes/sbmd-observability-instrumentation/tasks.md | Step-by-step implementation plan (C++ changes + tests). |
| openspec/changes/sbmd-observability-instrumentation/.openspec.yaml | Registers the change as a spec-driven OpenSpec change with creation date. |
cleithner-comcast
left a comment
There was a problem hiding this comment.
If I might also suggest a gauge for GC root entries on the mquickjs list. I would like to know if we are "leaking" root entries over time from misuse of [Safe]JSValue. I am not sure the best way to do this, may require a patch to expose the list size.
Will explore this and figure out what we might be able to do. |
Add change proposal, design, spec, and task list for wiring the existing
observability API into the SBMDv4 JS runtime.
Metrics defined:
GC tracking is deferred to a follow-on change.