getsentry / getsentry/sentry-javascript
feat(node): Add garbage collection metrics to NodeRuntimeMetrics
- Langage dominant
- TypeScript
- Étoiles
- 8.7k
- Forks
- 1.8k
- Merge moyen
- 1 j 17 h
- PR mergées (30 j)
- 523
Description
### 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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- node.js, typescript
- Domaine
- observability
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100