getsentry / getsentry/sentry-javascript
feat(node): Add garbage collection metrics to NodeRuntimeMetrics
- Ngôn ngữ chính
- TypeScript
- Star
- 8.7k
- Fork
- 1.8k
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 515
Mô tả
### 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.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start at the NodeRuntimeMetrics implementation and its existing collection interval and advanced collect options. Read the Node.js perf_hooks PerformanceObserver documentation for gc entries, then trace how current heap, RSS, event-loop delay, and ELU metrics are aggregated. Done means GC pause totals and an aggregate worst-pause metric are reported, with counts split by minor and major collection kind.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- node.js, typescript
- Lĩnh vực
- observability
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100