Skip to content

Auto Node.js runtime metrics integration #19866

@chargome

Description

@chargome

Currently there's no way to get process-level health metrics out of Sentry for Node.js without writing custom instrumentation. We want to add a new opt-in integration nodeRuntimeMetricsIntegration which auto-collects metrics in a loop.

Metrics

Group Metric Type
CPU node.runtime.cpu.user gauge
node.runtime.cpu.system gauge
node.runtime.cpu.percent gauge
Memory node.runtime.mem.rss gauge
node.runtime.mem.heap_total gauge
node.runtime.mem.heap_used gauge
node.runtime.mem.external gauge
node.runtime.mem.array_buffers gauge
V8 Heap node.runtime.heap.total_heap_size gauge
node.runtime.heap.heap_size_limit gauge
node.runtime.heap.total_available_size gauge
node.runtime.heap.malloced_memory gauge
node.runtime.heap.number_of_detached_contexts gauge
GC node.runtime.gc.duration distribution
node.runtime.gc.count counter
Event Loop Delay node.runtime.event_loop.delay.min gauge
node.runtime.event_loop.delay.max gauge
node.runtime.event_loop.delay.mean gauge
node.runtime.event_loop.delay.p50 gauge
node.runtime.event_loop.delay.p90 gauge
node.runtime.event_loop.delay.p99 gauge
Event Loop Utilization node.runtime.event_loop.utilization gauge
System node.runtime.system.free_memory gauge
node.runtime.system.total_memory gauge
Process node.runtime.process.uptime counter
Heap Spaces (opt-in) node.runtime.heap.space.size gauge
node.runtime.heap.space.used_size gauge
node.runtime.heap.space.available_size gauge
node.runtime.heap.space.physical_size gauge

GC metrics tagged by gc_type. Heap space metrics tagged by heap_space.

Open questions

  1. Metric name prefixnode.runtime.* vs. nodejs.* (OTel semconv)
  2. GC distribution — requires backend confirmation; fallback is separate min/max/mean/p95 gauges
  3. Default collection interval — 60s vs. 10–30s, pipeline cost vs. resolution tradeoff
  4. Serverless — flush per-invocation instead of on a timer?
  5. Cluster moderuntime_id / process_id attribute needed to disambiguate workers

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions