sentry-javascript
sentry-javascript copied to clipboard
Include `event.contexts.device.processor_count` for browser and node
Problem Statement
Most platforms now have a way to get the CPU count.
Solution Brainstorm
In browsers navigator.hardwareConcurrency has been around for a while. Safari apparently caps this as 2 for iOS and 8 for macOS.
Node.js has had os.cpus() since pre v1.
We’ve been tracking this as a span on transactions for performance monitoring. https://github.com/getsentry/sentry-javascript/blob/7a0dc5458cf92acae1cdf257121da1d3029c4b29/packages/tracing/src/browser/metrics/index.ts#L386