MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getOsContext

Function getOsContext

packages/node-core/src/integrations/context.ts:264–277  ·  view source on GitHub ↗

* Returns the operating system context. * * Based on the current platform, this uses a different strategy to provide the * most accurate OS information. Since this might involve spawning subprocesses * or accessing the file system, this should only be executed lazily and cached. * * - On macO

()

Source from the content-addressed store, hash-verified

262 * that `version` might actually be the kernel version.
263 */
264async function getOsContext(): Promise<OsContext> {
265 const platformId = os.platform();
266 switch (platformId) {
267 case 'darwin':
268 return getDarwinInfo();
269 case 'linux':
270 return getLinuxInfo();
271 default:
272 return {
273 name: PLATFORM_NAMES[platformId] || platformId,
274 version: os.release(),
275 };
276 }
277}
278
279function getCultureContext(): CultureContext | undefined {
280 try {

Callers 1

context.tsFile · 0.85

Calls 3

getDarwinInfoFunction · 0.85
getLinuxInfoFunction · 0.85
releaseMethod · 0.65

Tested by

no test coverage detected