@sentry/core
Advanced tools
Comparing version 8.37.1 to 8.38.0
@@ -39,2 +39,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const trpcContext = { | ||
procedure_path: path, | ||
procedure_type: type, | ||
@@ -58,26 +59,28 @@ }; | ||
} | ||
exports$1.setContext('trpc', trpcContext); | ||
return trace.startSpanManual( | ||
{ | ||
name: `trpc/${path}`, | ||
op: 'rpc.server', | ||
attributes: { | ||
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', | ||
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.rpc.trpc', | ||
return currentScopes.withScope(scope => { | ||
scope.setContext('trpc', trpcContext); | ||
return trace.startSpanManual( | ||
{ | ||
name: `trpc/${path}`, | ||
op: 'rpc.server', | ||
attributes: { | ||
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', | ||
[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.rpc.trpc', | ||
}, | ||
}, | ||
}, | ||
async span => { | ||
try { | ||
const nextResult = await next(); | ||
captureIfError(nextResult); | ||
span.end(); | ||
return nextResult; | ||
} catch (e) { | ||
exports$1.captureException(e, trpcCaptureContext); | ||
span.end(); | ||
throw e; | ||
} | ||
}, | ||
) ; | ||
async span => { | ||
try { | ||
const nextResult = await next(); | ||
captureIfError(nextResult); | ||
span.end(); | ||
return nextResult; | ||
} catch (e) { | ||
exports$1.captureException(e, trpcCaptureContext); | ||
span.end(); | ||
throw e; | ||
} | ||
}, | ||
) ; | ||
}); | ||
}; | ||
@@ -84,0 +87,0 @@ } |
@@ -151,4 +151,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const debugIdStackParserCache = new WeakMap(); | ||
/** | ||
@@ -158,42 +156,5 @@ * Puts debug IDs into the stack frames of an error event. | ||
function applyDebugIds(event, stackParser) { | ||
const debugIdMap = utils.GLOBAL_OBJ._sentryDebugIds; | ||
if (!debugIdMap) { | ||
return; | ||
} | ||
let debugIdStackFramesCache; | ||
const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser); | ||
if (cachedDebugIdStackFrameCache) { | ||
debugIdStackFramesCache = cachedDebugIdStackFrameCache; | ||
} else { | ||
debugIdStackFramesCache = new Map(); | ||
debugIdStackParserCache.set(stackParser, debugIdStackFramesCache); | ||
} | ||
// Build a map of filename -> debug_id | ||
const filenameDebugIdMap = Object.entries(debugIdMap).reduce( | ||
(acc, [debugIdStackTrace, debugIdValue]) => { | ||
let parsedStack; | ||
const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace); | ||
if (cachedParsedStack) { | ||
parsedStack = cachedParsedStack; | ||
} else { | ||
parsedStack = stackParser(debugIdStackTrace); | ||
debugIdStackFramesCache.set(debugIdStackTrace, parsedStack); | ||
} | ||
const filenameDebugIdMap = utils.getFilenameToDebugIdMap(stackParser); | ||
for (let i = parsedStack.length - 1; i >= 0; i--) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const stackFrame = parsedStack[i]; | ||
if (stackFrame.filename) { | ||
acc[stackFrame.filename] = debugIdValue; | ||
break; | ||
} | ||
} | ||
return acc; | ||
}, | ||
{}, | ||
); | ||
try { | ||
@@ -200,0 +161,0 @@ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion |
@@ -1,1 +0,1 @@ | ||
{"type":"module","version":"8.37.1","sideEffects":false} | ||
{"type":"module","version":"8.38.0","sideEffects":false} |
import { normalize } from '@sentry/utils'; | ||
import { getClient } from './currentScopes.js'; | ||
import { setContext, captureException } from './exports.js'; | ||
import { getClient, withScope } from './currentScopes.js'; | ||
import { captureException } from './exports.js'; | ||
import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes.js'; | ||
@@ -37,2 +37,3 @@ import './tracing/errors.js'; | ||
const trpcContext = { | ||
procedure_path: path, | ||
procedure_type: type, | ||
@@ -56,26 +57,28 @@ }; | ||
} | ||
setContext('trpc', trpcContext); | ||
return startSpanManual( | ||
{ | ||
name: `trpc/${path}`, | ||
op: 'rpc.server', | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.rpc.trpc', | ||
return withScope(scope => { | ||
scope.setContext('trpc', trpcContext); | ||
return startSpanManual( | ||
{ | ||
name: `trpc/${path}`, | ||
op: 'rpc.server', | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.rpc.trpc', | ||
}, | ||
}, | ||
}, | ||
async span => { | ||
try { | ||
const nextResult = await next(); | ||
captureIfError(nextResult); | ||
span.end(); | ||
return nextResult; | ||
} catch (e) { | ||
captureException(e, trpcCaptureContext); | ||
span.end(); | ||
throw e; | ||
} | ||
}, | ||
) ; | ||
async span => { | ||
try { | ||
const nextResult = await next(); | ||
captureIfError(nextResult); | ||
span.end(); | ||
return nextResult; | ||
} catch (e) { | ||
captureException(e, trpcCaptureContext); | ||
span.end(); | ||
throw e; | ||
} | ||
}, | ||
) ; | ||
}); | ||
}; | ||
@@ -82,0 +85,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils'; | ||
import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, getFilenameToDebugIdMap, normalize } from '@sentry/utils'; | ||
import { DEFAULT_ENVIRONMENT } from '../constants.js'; | ||
@@ -149,4 +149,2 @@ import { getGlobalScope } from '../currentScopes.js'; | ||
const debugIdStackParserCache = new WeakMap(); | ||
/** | ||
@@ -156,42 +154,5 @@ * Puts debug IDs into the stack frames of an error event. | ||
function applyDebugIds(event, stackParser) { | ||
const debugIdMap = GLOBAL_OBJ._sentryDebugIds; | ||
if (!debugIdMap) { | ||
return; | ||
} | ||
let debugIdStackFramesCache; | ||
const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser); | ||
if (cachedDebugIdStackFrameCache) { | ||
debugIdStackFramesCache = cachedDebugIdStackFrameCache; | ||
} else { | ||
debugIdStackFramesCache = new Map(); | ||
debugIdStackParserCache.set(stackParser, debugIdStackFramesCache); | ||
} | ||
// Build a map of filename -> debug_id | ||
const filenameDebugIdMap = Object.entries(debugIdMap).reduce( | ||
(acc, [debugIdStackTrace, debugIdValue]) => { | ||
let parsedStack; | ||
const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace); | ||
if (cachedParsedStack) { | ||
parsedStack = cachedParsedStack; | ||
} else { | ||
parsedStack = stackParser(debugIdStackTrace); | ||
debugIdStackFramesCache.set(debugIdStackTrace, parsedStack); | ||
} | ||
const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); | ||
for (let i = parsedStack.length - 1; i >= 0; i--) { | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const stackFrame = parsedStack[i]; | ||
if (stackFrame.filename) { | ||
acc[stackFrame.filename] = debugIdValue; | ||
break; | ||
} | ||
} | ||
return acc; | ||
}, | ||
{}, | ||
); | ||
try { | ||
@@ -198,0 +159,0 @@ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion |
{ | ||
"name": "@sentry/core", | ||
"version": "8.37.1", | ||
"version": "8.38.0", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -42,4 +42,4 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/types": "8.37.1", | ||
"@sentry/utils": "8.37.1" | ||
"@sentry/types": "8.38.0", | ||
"@sentry/utils": "8.38.0" | ||
}, | ||
@@ -46,0 +46,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1912670
21150
+ Added@sentry/types@8.38.0(transitive)
+ Added@sentry/utils@8.38.0(transitive)
- Removed@sentry/types@8.37.1(transitive)
- Removed@sentry/utils@8.37.1(transitive)
Updated@sentry/types@8.38.0
Updated@sentry/utils@8.38.0