Skip to content

feat(node): Add garbage collection metrics to NodeRuntimeMetrics #23272

Description

@timfish

Description

NodeRuntimeMetrics already collects heap, RSS, event loop delay, and ELU, but has no visibility into GC — often the direct cause of event-loop stalls and tail latency.

Add GC pause metrics collected via a perf_hooks PerformanceObserver on gc entries, aggregated over the existing collection interval:

  • gc.pause.duration (total/avg pause time)
  • gc.pause.max or gc.pause.p95 (worst pause in the window)
  • gc.count broken down by kind (minor/scavenge vs major/mark-sweep)

Opt-in by default, consistent with the other advanced metrics in the collect option. Aligns with the OTel process.runtime.v8js.gc.* conventions.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions