@sentry/core
Advanced tools
Comparing version 7.91.0 to 7.92.0
@@ -282,2 +282,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
* @returns The last event id of a captured event. | ||
* @deprecated This function will be removed in the next major version of the Sentry SDK. | ||
*/ | ||
@@ -284,0 +285,0 @@ function lastEventId() { |
@@ -44,7 +44,24 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
client, | ||
scope$1 = new scope.Scope(), | ||
isolationScope = new scope.Scope(), | ||
scope$1, | ||
isolationScope, | ||
_version = API_VERSION, | ||
) {this._version = _version; | ||
this._stack = [{ scope: scope$1 }]; | ||
let assignedScope; | ||
if (!scope$1) { | ||
assignedScope = new scope.Scope(); | ||
assignedScope.setClient(client); | ||
} else { | ||
assignedScope = scope$1; | ||
} | ||
let assignedIsolationScope; | ||
if (!isolationScope) { | ||
assignedIsolationScope = new scope.Scope(); | ||
assignedIsolationScope.setClient(client); | ||
} else { | ||
assignedIsolationScope = isolationScope; | ||
} | ||
this._stack = [{ scope: assignedScope }]; | ||
if (client) { | ||
@@ -54,3 +71,3 @@ this.bindClient(client); | ||
this._isolationScope = isolationScope; | ||
this._isolationScope = assignedIsolationScope; | ||
} | ||
@@ -107,8 +124,31 @@ | ||
const scope = this.pushScope(); | ||
let maybePromiseResult; | ||
try { | ||
return callback(scope); | ||
} finally { | ||
maybePromiseResult = callback(scope); | ||
} catch (e) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
throw e; | ||
} | ||
if (utils.isThenable(maybePromiseResult)) { | ||
// @ts-expect-error - isThenable returns the wrong type | ||
return maybePromiseResult.then( | ||
res => { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
return res; | ||
}, | ||
e => { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
throw e; | ||
}, | ||
); | ||
} | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
return maybePromiseResult; | ||
} | ||
@@ -115,0 +155,0 @@ |
@@ -34,2 +34,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const isSentryRequestUrl = require('./utils/isSentryRequestUrl.js'); | ||
const handleCallbackErrors = require('./utils/handleCallbackErrors.js'); | ||
const spanUtils = require('./utils/spanUtils.js'); | ||
const constants = require('./constants.js'); | ||
@@ -128,2 +130,4 @@ const metadata = require('./integrations/metadata.js'); | ||
exports.isSentryRequestUrl = isSentryRequestUrl.isSentryRequestUrl; | ||
exports.handleCallbackErrors = handleCallbackErrors.handleCallbackErrors; | ||
exports.spanToTraceHeader = spanUtils.spanToTraceHeader; | ||
exports.DEFAULT_ENVIRONMENT = constants.DEFAULT_ENVIRONMENT; | ||
@@ -130,0 +134,0 @@ exports.ModuleMetadata = metadata.ModuleMetadata; |
@@ -62,2 +62,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** The client on this scope */ | ||
// NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. | ||
@@ -107,2 +109,3 @@ | ||
newScope._propagationContext = { ...this._propagationContext }; | ||
newScope._client = this._client; | ||
@@ -112,3 +115,17 @@ return newScope; | ||
/** Update the client on the scope. */ | ||
setClient(client) { | ||
this._client = client; | ||
} | ||
/** | ||
* Get the client assigned to this scope. | ||
* | ||
* It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing. | ||
*/ | ||
getClient() { | ||
return this._client; | ||
} | ||
/** | ||
* Add internal on change listener. Used for sub SDKs that need to store the scope. | ||
@@ -115,0 +132,0 @@ * @hidden |
@@ -11,2 +11,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const hubextensions = require('./tracing/hubextensions.js'); | ||
const spanUtils = require('./utils/spanUtils.js'); | ||
const dynamicSamplingContext = require('./tracing/dynamicSamplingContext.js'); | ||
@@ -242,3 +243,3 @@ require('./tracing/spanstatus.js'); | ||
const samplingContext = span.transaction ? span.transaction.getDynamicSamplingContext() : undefined; | ||
return [samplingContext, span.getTraceContext()]; | ||
return [samplingContext, spanUtils.spanToTraceContext(span)]; | ||
} | ||
@@ -245,0 +246,0 @@ |
@@ -6,2 +6,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const hub = require('../hub.js'); | ||
const spanUtils = require('../utils/spanUtils.js'); | ||
const errors = require('./errors.js'); | ||
@@ -19,3 +20,3 @@ const idletransaction = require('./idletransaction.js'); | ||
? { | ||
'sentry-trace': span.toTraceparent(), | ||
'sentry-trace': spanUtils.spanToTraceHeader(span), | ||
} | ||
@@ -22,0 +23,0 @@ : {}; |
@@ -5,2 +5,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const debugBuild = require('../debug-build.js'); | ||
const spanUtils = require('../utils/spanUtils.js'); | ||
const utils$1 = require('./utils.js'); | ||
@@ -86,2 +87,6 @@ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
/** | ||
* List of spans that were finalized | ||
@@ -115,2 +120,3 @@ */ | ||
this.data = spanContext.data || {}; | ||
this.attributes = spanContext.attributes || {}; | ||
this.instrumenter = spanContext.instrumenter || 'sentry'; | ||
@@ -147,5 +153,7 @@ this.origin = spanContext.origin || 'manual'; | ||
} | ||
/** Update the name of the span. */ | ||
/** | ||
* Update the name of the span. | ||
*/ | ||
set name(name) { | ||
this.setName(name); | ||
this.updateName(name); | ||
} | ||
@@ -197,3 +205,3 @@ | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
setData(key, value) { | ||
@@ -204,2 +212,17 @@ this.data = { ...this.data, [key]: value }; | ||
/** @inheritdoc */ | ||
setAttribute(key, value) { | ||
if (value === undefined) { | ||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
delete this.attributes[key]; | ||
} else { | ||
this.attributes[key] = value; | ||
} | ||
} | ||
/** @inheritdoc */ | ||
setAttributes(attributes) { | ||
Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key])); | ||
} | ||
/** | ||
@@ -226,7 +249,13 @@ * @inheritDoc | ||
/** @inheritdoc */ | ||
setName(name) { | ||
this.updateName(name); | ||
} | ||
/** | ||
* @inheritDoc | ||
*/ | ||
setName(name) { | ||
updateName(name) { | ||
this.description = name; | ||
return this; | ||
} | ||
@@ -272,3 +301,3 @@ | ||
toTraceparent() { | ||
return utils.generateSentryTraceHeader(this.traceId, this.spanId, this.sampled); | ||
return spanUtils.spanToTraceHeader(this); | ||
} | ||
@@ -281,3 +310,3 @@ | ||
return utils.dropUndefinedKeys({ | ||
data: this.data, | ||
data: this._getData(), | ||
description: this.description, | ||
@@ -319,13 +348,3 @@ endTimestamp: this.endTimestamp, | ||
getTraceContext() { | ||
return utils.dropUndefinedKeys({ | ||
data: Object.keys(this.data).length > 0 ? this.data : undefined, | ||
description: this.description, | ||
op: this.op, | ||
parent_span_id: this.parentSpanId, | ||
span_id: this.spanId, | ||
status: this.status, | ||
tags: Object.keys(this.tags).length > 0 ? this.tags : undefined, | ||
trace_id: this.traceId, | ||
origin: this.origin, | ||
}); | ||
return spanUtils.spanToTraceContext(this); | ||
} | ||
@@ -340,3 +359,3 @@ | ||
return utils.dropUndefinedKeys({ | ||
data: Object.keys(this.data).length > 0 ? this.data : undefined, | ||
data: this._getData(), | ||
description: this.description, | ||
@@ -354,2 +373,29 @@ op: this.op, | ||
} | ||
/** | ||
* Get the merged data for this span. | ||
* For now, this combines `data` and `attributes` together, | ||
* until eventually we can ingest `attributes` directly. | ||
*/ | ||
_getData() | ||
{ | ||
const { data, attributes } = this; | ||
const hasData = Object.keys(data).length > 0; | ||
const hasAttributes = Object.keys(attributes).length > 0; | ||
if (!hasData && !hasAttributes) { | ||
return undefined; | ||
} | ||
if (hasData && hasAttributes) { | ||
return { | ||
...data, | ||
...attributes, | ||
}; | ||
} | ||
return hasData ? data : attributes; | ||
} | ||
} | ||
@@ -356,0 +402,0 @@ |
@@ -7,2 +7,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const hub = require('../hub.js'); | ||
const handleCallbackErrors = require('../utils/handleCallbackErrors.js'); | ||
const hasTracingEnabled = require('../utils/hasTracingEnabled.js'); | ||
@@ -21,2 +22,4 @@ | ||
* @private | ||
* | ||
* @deprecated Use `startSpan` instead. | ||
*/ | ||
@@ -41,39 +44,14 @@ function trace( | ||
function finishAndSetSpan() { | ||
activeSpan && activeSpan.end(); | ||
scope.setSpan(parentSpan); | ||
} | ||
let maybePromiseResult; | ||
try { | ||
maybePromiseResult = callback(activeSpan); | ||
} catch (e) { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
onError(e, activeSpan); | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
throw e; | ||
} | ||
if (utils.isThenable(maybePromiseResult)) { | ||
// @ts-expect-error - the isThenable check returns the "wrong" type here | ||
return maybePromiseResult.then( | ||
res => { | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
return res; | ||
}, | ||
e => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
onError(e, activeSpan); | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
throw e; | ||
}, | ||
); | ||
} | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
return maybePromiseResult; | ||
return handleCallbackErrors.handleCallbackErrors( | ||
() => callback(activeSpan), | ||
error => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
onError(error, activeSpan); | ||
}, | ||
() => { | ||
activeSpan && activeSpan.end(); | ||
scope.setSpan(parentSpan); | ||
afterFinish(); | ||
}, | ||
); | ||
} | ||
@@ -95,3 +73,2 @@ | ||
// @ts-expect-error - isThenable returns the wrong type | ||
return exports$1.withScope(scope => { | ||
@@ -104,31 +81,12 @@ const hub$1 = hub.getCurrentHub(); | ||
function finishAndSetSpan() { | ||
activeSpan && activeSpan.end(); | ||
} | ||
let maybePromiseResult; | ||
try { | ||
maybePromiseResult = callback(activeSpan); | ||
} catch (e) { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
finishAndSetSpan(); | ||
throw e; | ||
} | ||
if (utils.isThenable(maybePromiseResult)) { | ||
return maybePromiseResult.then( | ||
res => { | ||
finishAndSetSpan(); | ||
return res; | ||
}, | ||
e => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
finishAndSetSpan(); | ||
throw e; | ||
}, | ||
); | ||
} | ||
finishAndSetSpan(); | ||
return maybePromiseResult; | ||
return handleCallbackErrors.handleCallbackErrors( | ||
() => callback(activeSpan), | ||
() => { | ||
// Only update the span status if it hasn't been changed yet | ||
if (activeSpan && (!activeSpan.status || activeSpan.status === 'ok')) { | ||
activeSpan.setStatus('internal_error'); | ||
} | ||
}, | ||
() => activeSpan && activeSpan.end(), | ||
); | ||
}); | ||
@@ -144,3 +102,3 @@ } | ||
* Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span | ||
* after the function is done automatically. | ||
* after the function is done automatically. You'll have to call `span.end()` manually. | ||
* | ||
@@ -160,3 +118,2 @@ * The created span is the active span and will be used as parent by other spans created inside the function | ||
// @ts-expect-error - isThenable returns the wrong type | ||
return exports$1.withScope(scope => { | ||
@@ -173,21 +130,11 @@ const hub$1 = hub.getCurrentHub(); | ||
let maybePromiseResult; | ||
try { | ||
maybePromiseResult = callback(activeSpan, finishAndSetSpan); | ||
} catch (e) { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
throw e; | ||
} | ||
if (utils.isThenable(maybePromiseResult)) { | ||
return maybePromiseResult.then( | ||
res => res, | ||
e => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
throw e; | ||
}, | ||
); | ||
} | ||
return maybePromiseResult; | ||
return handleCallbackErrors.handleCallbackErrors( | ||
() => callback(activeSpan, finishAndSetSpan), | ||
() => { | ||
// Only update the span status if it hasn't been changed yet, and the span is not yet finished | ||
if (activeSpan && !activeSpan.endTimestamp && (!activeSpan.status || activeSpan.status === 'ok')) { | ||
activeSpan.setStatus('internal_error'); | ||
} | ||
}, | ||
); | ||
}); | ||
@@ -194,0 +141,0 @@ } |
@@ -6,2 +6,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const hub = require('../hub.js'); | ||
const spanUtils = require('../utils/spanUtils.js'); | ||
const dynamicSamplingContext = require('./dynamicSamplingContext.js'); | ||
@@ -63,4 +64,7 @@ const span = require('./span.js'); | ||
/** Setter for `name` property, which also sets `source` as custom */ | ||
/** | ||
* Setter for `name` property, which also sets `source` as custom. | ||
*/ | ||
set name(newName) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.setName(newName); | ||
@@ -70,3 +74,5 @@ } | ||
/** | ||
* JSDoc | ||
* Setter for `name` property, which also sets `source` on the metadata. | ||
* | ||
* @deprecated Use `updateName()` and `setMetadata()` instead. | ||
*/ | ||
@@ -78,2 +84,8 @@ setName(name, source = 'custom') { | ||
/** @inheritdoc */ | ||
updateName(name) { | ||
this._name = name; | ||
return this; | ||
} | ||
/** | ||
@@ -133,2 +145,3 @@ * Attaches SpanRecorder to the span itself | ||
toContext() { | ||
// eslint-disable-next-line deprecation/deprecation | ||
const spanContext = super.toContext(); | ||
@@ -147,2 +160,3 @@ | ||
updateWithContext(transactionContext) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
super.updateWithContext(transactionContext); | ||
@@ -256,3 +270,3 @@ | ||
// We don't want to override trace context | ||
trace: this.getTraceContext(), | ||
trace: spanUtils.spanToTraceContext(this), | ||
}, | ||
@@ -259,0 +273,0 @@ spans: finishedSpans, |
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const utils = require('@sentry/utils'); | ||
const spanUtils = require('./spanUtils.js'); | ||
@@ -134,3 +135,3 @@ /** | ||
function applySpanToEvent(event, span) { | ||
event.contexts = { trace: span.getTraceContext(), ...event.contexts }; | ||
event.contexts = { trace: spanUtils.spanToTraceContext(span), ...event.contexts }; | ||
const transaction = span.transaction; | ||
@@ -137,0 +138,0 @@ if (transaction) { |
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const SDK_VERSION = '7.91.0'; | ||
const SDK_VERSION = '7.92.0'; | ||
exports.SDK_VERSION = SDK_VERSION; | ||
//# sourceMappingURL=version.js.map |
@@ -280,2 +280,3 @@ import { logger, uuid4, timestampInSeconds, isThenable } from '@sentry/utils'; | ||
* @returns The last event id of a captured event. | ||
* @deprecated This function will be removed in the next major version of the Sentry SDK. | ||
*/ | ||
@@ -282,0 +283,0 @@ function lastEventId() { |
@@ -1,2 +0,2 @@ | ||
import { uuid4, dateTimestampInSeconds, consoleSandbox, logger, GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils'; | ||
import { isThenable, uuid4, dateTimestampInSeconds, consoleSandbox, logger, GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils'; | ||
import { DEFAULT_ENVIRONMENT } from './constants.js'; | ||
@@ -42,7 +42,24 @@ import { DEBUG_BUILD } from './debug-build.js'; | ||
client, | ||
scope = new Scope(), | ||
isolationScope = new Scope(), | ||
scope, | ||
isolationScope, | ||
_version = API_VERSION, | ||
) {this._version = _version; | ||
this._stack = [{ scope }]; | ||
let assignedScope; | ||
if (!scope) { | ||
assignedScope = new Scope(); | ||
assignedScope.setClient(client); | ||
} else { | ||
assignedScope = scope; | ||
} | ||
let assignedIsolationScope; | ||
if (!isolationScope) { | ||
assignedIsolationScope = new Scope(); | ||
assignedIsolationScope.setClient(client); | ||
} else { | ||
assignedIsolationScope = isolationScope; | ||
} | ||
this._stack = [{ scope: assignedScope }]; | ||
if (client) { | ||
@@ -52,3 +69,3 @@ this.bindClient(client); | ||
this._isolationScope = isolationScope; | ||
this._isolationScope = assignedIsolationScope; | ||
} | ||
@@ -105,8 +122,31 @@ | ||
const scope = this.pushScope(); | ||
let maybePromiseResult; | ||
try { | ||
return callback(scope); | ||
} finally { | ||
maybePromiseResult = callback(scope); | ||
} catch (e) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
throw e; | ||
} | ||
if (isThenable(maybePromiseResult)) { | ||
// @ts-expect-error - isThenable returns the wrong type | ||
return maybePromiseResult.then( | ||
res => { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
return res; | ||
}, | ||
e => { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
throw e; | ||
}, | ||
); | ||
} | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.popScope(); | ||
return maybePromiseResult; | ||
} | ||
@@ -113,0 +153,0 @@ |
@@ -33,2 +33,4 @@ export { addTracingExtensions, startIdleTransaction } from './tracing/hubextensions.js'; | ||
export { isSentryRequestUrl } from './utils/isSentryRequestUrl.js'; | ||
export { handleCallbackErrors } from './utils/handleCallbackErrors.js'; | ||
export { spanToTraceHeader } from './utils/spanUtils.js'; | ||
export { DEFAULT_ENVIRONMENT } from './constants.js'; | ||
@@ -35,0 +37,0 @@ export { ModuleMetadata } from './integrations/metadata.js'; |
@@ -60,2 +60,4 @@ import { isPlainObject, dateTimestampInSeconds, uuid4 } from '@sentry/utils'; | ||
/** The client on this scope */ | ||
// NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. | ||
@@ -105,2 +107,3 @@ | ||
newScope._propagationContext = { ...this._propagationContext }; | ||
newScope._client = this._client; | ||
@@ -110,3 +113,17 @@ return newScope; | ||
/** Update the client on the scope. */ | ||
setClient(client) { | ||
this._client = client; | ||
} | ||
/** | ||
* Get the client assigned to this scope. | ||
* | ||
* It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing. | ||
*/ | ||
getClient() { | ||
return this._client; | ||
} | ||
/** | ||
* Add internal on change listener. Used for sub SDKs that need to store the scope. | ||
@@ -113,0 +130,0 @@ * @hidden |
@@ -9,2 +9,3 @@ import { resolvedSyncPromise, eventFromUnknownInput, eventFromMessage, logger, uuid4 } from '@sentry/utils'; | ||
import { addTracingExtensions } from './tracing/hubextensions.js'; | ||
import { spanToTraceContext } from './utils/spanUtils.js'; | ||
import { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js'; | ||
@@ -240,3 +241,3 @@ import './tracing/spanstatus.js'; | ||
const samplingContext = span.transaction ? span.transaction.getDynamicSamplingContext() : undefined; | ||
return [samplingContext, span.getTraceContext()]; | ||
return [samplingContext, spanToTraceContext(span)]; | ||
} | ||
@@ -243,0 +244,0 @@ |
import { logger } from '@sentry/utils'; | ||
import { DEBUG_BUILD } from '../debug-build.js'; | ||
import { getMainCarrier } from '../hub.js'; | ||
import { spanToTraceHeader } from '../utils/spanUtils.js'; | ||
import { registerErrorInstrumentation } from './errors.js'; | ||
@@ -16,3 +17,3 @@ import { IdleTransaction } from './idletransaction.js'; | ||
? { | ||
'sentry-trace': span.toTraceparent(), | ||
'sentry-trace': spanToTraceHeader(span), | ||
} | ||
@@ -19,0 +20,0 @@ : {}; |
@@ -1,3 +0,4 @@ | ||
import { uuid4, timestampInSeconds, logger, generateSentryTraceHeader, dropUndefinedKeys } from '@sentry/utils'; | ||
import { uuid4, timestampInSeconds, logger, dropUndefinedKeys } from '@sentry/utils'; | ||
import { DEBUG_BUILD } from '../debug-build.js'; | ||
import { spanToTraceHeader, spanToTraceContext } from '../utils/spanUtils.js'; | ||
import { ensureTimestampInSeconds } from './utils.js'; | ||
@@ -83,2 +84,6 @@ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
/** | ||
* List of spans that were finalized | ||
@@ -112,2 +117,3 @@ */ | ||
this.data = spanContext.data || {}; | ||
this.attributes = spanContext.attributes || {}; | ||
this.instrumenter = spanContext.instrumenter || 'sentry'; | ||
@@ -144,5 +150,7 @@ this.origin = spanContext.origin || 'manual'; | ||
} | ||
/** Update the name of the span. */ | ||
/** | ||
* Update the name of the span. | ||
*/ | ||
set name(name) { | ||
this.setName(name); | ||
this.updateName(name); | ||
} | ||
@@ -194,3 +202,3 @@ | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
setData(key, value) { | ||
@@ -201,2 +209,17 @@ this.data = { ...this.data, [key]: value }; | ||
/** @inheritdoc */ | ||
setAttribute(key, value) { | ||
if (value === undefined) { | ||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
delete this.attributes[key]; | ||
} else { | ||
this.attributes[key] = value; | ||
} | ||
} | ||
/** @inheritdoc */ | ||
setAttributes(attributes) { | ||
Object.keys(attributes).forEach(key => this.setAttribute(key, attributes[key])); | ||
} | ||
/** | ||
@@ -223,7 +246,13 @@ * @inheritDoc | ||
/** @inheritdoc */ | ||
setName(name) { | ||
this.updateName(name); | ||
} | ||
/** | ||
* @inheritDoc | ||
*/ | ||
setName(name) { | ||
updateName(name) { | ||
this.description = name; | ||
return this; | ||
} | ||
@@ -269,3 +298,3 @@ | ||
toTraceparent() { | ||
return generateSentryTraceHeader(this.traceId, this.spanId, this.sampled); | ||
return spanToTraceHeader(this); | ||
} | ||
@@ -278,3 +307,3 @@ | ||
return dropUndefinedKeys({ | ||
data: this.data, | ||
data: this._getData(), | ||
description: this.description, | ||
@@ -316,13 +345,3 @@ endTimestamp: this.endTimestamp, | ||
getTraceContext() { | ||
return dropUndefinedKeys({ | ||
data: Object.keys(this.data).length > 0 ? this.data : undefined, | ||
description: this.description, | ||
op: this.op, | ||
parent_span_id: this.parentSpanId, | ||
span_id: this.spanId, | ||
status: this.status, | ||
tags: Object.keys(this.tags).length > 0 ? this.tags : undefined, | ||
trace_id: this.traceId, | ||
origin: this.origin, | ||
}); | ||
return spanToTraceContext(this); | ||
} | ||
@@ -337,3 +356,3 @@ | ||
return dropUndefinedKeys({ | ||
data: Object.keys(this.data).length > 0 ? this.data : undefined, | ||
data: this._getData(), | ||
description: this.description, | ||
@@ -351,2 +370,29 @@ op: this.op, | ||
} | ||
/** | ||
* Get the merged data for this span. | ||
* For now, this combines `data` and `attributes` together, | ||
* until eventually we can ingest `attributes` directly. | ||
*/ | ||
_getData() | ||
{ | ||
const { data, attributes } = this; | ||
const hasData = Object.keys(data).length > 0; | ||
const hasAttributes = Object.keys(attributes).length > 0; | ||
if (!hasData && !hasAttributes) { | ||
return undefined; | ||
} | ||
if (hasData && hasAttributes) { | ||
return { | ||
...data, | ||
...attributes, | ||
}; | ||
} | ||
return hasData ? data : attributes; | ||
} | ||
} | ||
@@ -353,0 +399,0 @@ |
@@ -1,5 +0,6 @@ | ||
import { isThenable, tracingContextFromHeaders, logger, dropUndefinedKeys } from '@sentry/utils'; | ||
import { tracingContextFromHeaders, logger, dropUndefinedKeys } from '@sentry/utils'; | ||
import { DEBUG_BUILD } from '../debug-build.js'; | ||
import { getCurrentScope, withScope } from '../exports.js'; | ||
import { getCurrentHub } from '../hub.js'; | ||
import { handleCallbackErrors } from '../utils/handleCallbackErrors.js'; | ||
import { hasTracingEnabled } from '../utils/hasTracingEnabled.js'; | ||
@@ -18,2 +19,4 @@ | ||
* @private | ||
* | ||
* @deprecated Use `startSpan` instead. | ||
*/ | ||
@@ -38,39 +41,14 @@ function trace( | ||
function finishAndSetSpan() { | ||
activeSpan && activeSpan.end(); | ||
scope.setSpan(parentSpan); | ||
} | ||
let maybePromiseResult; | ||
try { | ||
maybePromiseResult = callback(activeSpan); | ||
} catch (e) { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
onError(e, activeSpan); | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
throw e; | ||
} | ||
if (isThenable(maybePromiseResult)) { | ||
// @ts-expect-error - the isThenable check returns the "wrong" type here | ||
return maybePromiseResult.then( | ||
res => { | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
return res; | ||
}, | ||
e => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
onError(e, activeSpan); | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
throw e; | ||
}, | ||
); | ||
} | ||
finishAndSetSpan(); | ||
afterFinish(); | ||
return maybePromiseResult; | ||
return handleCallbackErrors( | ||
() => callback(activeSpan), | ||
error => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
onError(error, activeSpan); | ||
}, | ||
() => { | ||
activeSpan && activeSpan.end(); | ||
scope.setSpan(parentSpan); | ||
afterFinish(); | ||
}, | ||
); | ||
} | ||
@@ -92,3 +70,2 @@ | ||
// @ts-expect-error - isThenable returns the wrong type | ||
return withScope(scope => { | ||
@@ -101,31 +78,12 @@ const hub = getCurrentHub(); | ||
function finishAndSetSpan() { | ||
activeSpan && activeSpan.end(); | ||
} | ||
let maybePromiseResult; | ||
try { | ||
maybePromiseResult = callback(activeSpan); | ||
} catch (e) { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
finishAndSetSpan(); | ||
throw e; | ||
} | ||
if (isThenable(maybePromiseResult)) { | ||
return maybePromiseResult.then( | ||
res => { | ||
finishAndSetSpan(); | ||
return res; | ||
}, | ||
e => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
finishAndSetSpan(); | ||
throw e; | ||
}, | ||
); | ||
} | ||
finishAndSetSpan(); | ||
return maybePromiseResult; | ||
return handleCallbackErrors( | ||
() => callback(activeSpan), | ||
() => { | ||
// Only update the span status if it hasn't been changed yet | ||
if (activeSpan && (!activeSpan.status || activeSpan.status === 'ok')) { | ||
activeSpan.setStatus('internal_error'); | ||
} | ||
}, | ||
() => activeSpan && activeSpan.end(), | ||
); | ||
}); | ||
@@ -141,3 +99,3 @@ } | ||
* Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span | ||
* after the function is done automatically. | ||
* after the function is done automatically. You'll have to call `span.end()` manually. | ||
* | ||
@@ -157,3 +115,2 @@ * The created span is the active span and will be used as parent by other spans created inside the function | ||
// @ts-expect-error - isThenable returns the wrong type | ||
return withScope(scope => { | ||
@@ -170,21 +127,11 @@ const hub = getCurrentHub(); | ||
let maybePromiseResult; | ||
try { | ||
maybePromiseResult = callback(activeSpan, finishAndSetSpan); | ||
} catch (e) { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
throw e; | ||
} | ||
if (isThenable(maybePromiseResult)) { | ||
return maybePromiseResult.then( | ||
res => res, | ||
e => { | ||
activeSpan && activeSpan.setStatus('internal_error'); | ||
throw e; | ||
}, | ||
); | ||
} | ||
return maybePromiseResult; | ||
return handleCallbackErrors( | ||
() => callback(activeSpan, finishAndSetSpan), | ||
() => { | ||
// Only update the span status if it hasn't been changed yet, and the span is not yet finished | ||
if (activeSpan && !activeSpan.endTimestamp && (!activeSpan.status || activeSpan.status === 'ok')) { | ||
activeSpan.setStatus('internal_error'); | ||
} | ||
}, | ||
); | ||
}); | ||
@@ -191,0 +138,0 @@ } |
import { timestampInSeconds, dropUndefinedKeys, logger } from '@sentry/utils'; | ||
import { DEBUG_BUILD } from '../debug-build.js'; | ||
import { getCurrentHub } from '../hub.js'; | ||
import { spanToTraceContext } from '../utils/spanUtils.js'; | ||
import { getDynamicSamplingContextFromClient } from './dynamicSamplingContext.js'; | ||
@@ -60,4 +61,7 @@ import { Span, SpanRecorder } from './span.js'; | ||
/** Setter for `name` property, which also sets `source` as custom */ | ||
/** | ||
* Setter for `name` property, which also sets `source` as custom. | ||
*/ | ||
set name(newName) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
this.setName(newName); | ||
@@ -67,3 +71,5 @@ } | ||
/** | ||
* JSDoc | ||
* Setter for `name` property, which also sets `source` on the metadata. | ||
* | ||
* @deprecated Use `updateName()` and `setMetadata()` instead. | ||
*/ | ||
@@ -75,2 +81,8 @@ setName(name, source = 'custom') { | ||
/** @inheritdoc */ | ||
updateName(name) { | ||
this._name = name; | ||
return this; | ||
} | ||
/** | ||
@@ -130,2 +142,3 @@ * Attaches SpanRecorder to the span itself | ||
toContext() { | ||
// eslint-disable-next-line deprecation/deprecation | ||
const spanContext = super.toContext(); | ||
@@ -144,2 +157,3 @@ | ||
updateWithContext(transactionContext) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
super.updateWithContext(transactionContext); | ||
@@ -253,3 +267,3 @@ | ||
// We don't want to override trace context | ||
trace: this.getTraceContext(), | ||
trace: spanToTraceContext(this), | ||
}, | ||
@@ -256,0 +270,0 @@ spans: finishedSpans, |
import { arrayify } from '@sentry/utils'; | ||
import { spanToTraceContext } from './spanUtils.js'; | ||
@@ -132,3 +133,3 @@ /** | ||
function applySpanToEvent(event, span) { | ||
event.contexts = { trace: span.getTraceContext(), ...event.contexts }; | ||
event.contexts = { trace: spanToTraceContext(span), ...event.contexts }; | ||
const transaction = span.transaction; | ||
@@ -135,0 +136,0 @@ if (transaction) { |
@@ -1,4 +0,4 @@ | ||
const SDK_VERSION = '7.91.0'; | ||
const SDK_VERSION = '7.92.0'; | ||
export { SDK_VERSION }; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@sentry/core", | ||
"version": "7.91.0", | ||
"version": "7.92.0", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -12,2 +12,8 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
}, | ||
"files": [ | ||
"cjs", | ||
"esm", | ||
"types", | ||
"types-ts3.8" | ||
], | ||
"main": "cjs/index.js", | ||
@@ -27,6 +33,6 @@ "module": "esm/index.js", | ||
"dependencies": { | ||
"@sentry/types": "7.91.0", | ||
"@sentry/utils": "7.91.0" | ||
"@sentry/types": "7.92.0", | ||
"@sentry/utils": "7.92.0" | ||
}, | ||
"sideEffects": false | ||
} |
@@ -156,2 +156,3 @@ import { Breadcrumb, BreadcrumbHint, CaptureContext, CheckIn, Client, CustomSamplingContext, Event, EventHint, Extra, Extras, MonitorConfig, Primitive, Severity, SeverityLevel, TransactionContext, User } from '@sentry/types'; | ||
* @returns The last event id of a captured event. | ||
* @deprecated This function will be removed in the next major version of the Sentry SDK. | ||
*/ | ||
@@ -158,0 +159,0 @@ export declare function lastEventId(): string | undefined; |
@@ -29,2 +29,4 @@ export { ClientClass } from './sdk'; | ||
export { isSentryRequestUrl } from './utils/isSentryRequestUrl'; | ||
export { handleCallbackErrors } from './utils/handleCallbackErrors'; | ||
export { spanToTraceHeader } from './utils/spanUtils'; | ||
export { DEFAULT_ENVIRONMENT } from './constants'; | ||
@@ -31,0 +33,0 @@ export { ModuleMetadata } from './integrations/metadata'; |
@@ -31,3 +31,3 @@ import { Client, EventProcessor, Hub, Integration, IntegrationFn, Options } from '@sentry/types'; | ||
*/ | ||
export declare function convertIntegrationFnToClass<Fn extends IntegrationFn>(name: string, fn: Fn): { | ||
export declare function convertIntegrationFnToClass<Fn extends IntegrationFn>(name: string, fn: Fn): Integration & { | ||
id: string; | ||
@@ -34,0 +34,0 @@ new (...args: Parameters<Fn>): Integration & ReturnType<Fn> & { |
/** Patch toString calls to return proper name for wrapped functions */ | ||
export declare const FunctionToString: { | ||
export declare const FunctionToString: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -4,0 +4,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -12,3 +12,3 @@ /** Options for the InboundFilters integration */ | ||
/** Inbound filters configurable by the user */ | ||
export declare const InboundFilters: { | ||
export declare const InboundFilters: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -15,0 +15,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
/** Adds SDK info to an event. */ | ||
export declare const LinkedErrors: { | ||
export declare const LinkedErrors: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -4,0 +4,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -10,3 +10,3 @@ /** | ||
*/ | ||
export declare const ModuleMetadata: { | ||
export declare const ModuleMetadata: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -13,0 +13,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -24,3 +24,3 @@ import { TransactionNamingScheme } from '@sentry/utils'; | ||
* so it can be used in cross-platform SDKs like `@sentry/nextjs`. */ | ||
export declare const RequestData: { | ||
export declare const RequestData: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -27,0 +27,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -36,3 +36,3 @@ import { MeasurementUnit, Primitive } from '@sentry/types'; | ||
gauge: typeof gauge; | ||
MetricsAggregator: { | ||
MetricsAggregator: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -39,0 +39,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
export declare const MetricsAggregator: { | ||
export declare const MetricsAggregator: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -9,0 +9,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -1,2 +0,2 @@ | ||
import { Attachment, Breadcrumb, CaptureContext, Context, Contexts, Event, EventHint, EventProcessor, Extra, Extras, Primitive, PropagationContext, RequestSession, Scope as ScopeInterface, ScopeData, Session, Severity, SeverityLevel, Span, Transaction, User } from '@sentry/types'; | ||
import { Attachment, Breadcrumb, CaptureContext, Client, Context, Contexts, Event, EventHint, EventProcessor, Extra, Extras, Primitive, PropagationContext, RequestSession, Scope as ScopeInterface, ScopeData, Session, Severity, SeverityLevel, Span, Transaction, User } from '@sentry/types'; | ||
/** | ||
@@ -48,2 +48,4 @@ * Holds additional event information. {@link Scope.applyToEvent} will be | ||
protected _requestSession?: RequestSession; | ||
/** The client on this scope */ | ||
protected _client?: Client; | ||
constructor(); | ||
@@ -59,3 +61,11 @@ /** | ||
clone(): Scope; | ||
/** Update the client on the scope. */ | ||
setClient(client: Client | undefined): void; | ||
/** | ||
* Get the client assigned to this scope. | ||
* | ||
* It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing. | ||
*/ | ||
getClient(): Client | undefined; | ||
/** | ||
* Add internal on change listener. Used for sub SDKs that need to store the scope. | ||
@@ -62,0 +72,0 @@ * @hidden |
@@ -1,2 +0,2 @@ | ||
import { Instrumenter, Primitive, Span as SpanInterface, SpanContext, SpanOrigin, TraceContext, Transaction } from '@sentry/types'; | ||
import { Instrumenter, Primitive, Span as SpanInterface, SpanAttributeValue, SpanAttributes, SpanContext, SpanOrigin, TraceContext, Transaction } from '@sentry/types'; | ||
/** | ||
@@ -73,2 +73,6 @@ * Keeps track of finished spans for a given transaction | ||
/** | ||
* @inheritDoc | ||
*/ | ||
attributes: SpanAttributes; | ||
/** | ||
* List of spans that were finalized | ||
@@ -98,3 +102,5 @@ */ | ||
/*An alias for `description` of the Span. | ||
Update the name of the span. */ | ||
* Update the name of the span. | ||
*/ | ||
name: string; | ||
@@ -113,2 +119,6 @@ /** | ||
setData(key: string, value: any): this; | ||
/** @inheritdoc */ | ||
setAttribute(key: string, value: SpanAttributeValue | undefined): void; | ||
/** @inheritdoc */ | ||
setAttributes(attributes: SpanAttributes): void; | ||
/** | ||
@@ -122,6 +132,8 @@ * @inheritDoc | ||
setHttpStatus(httpStatus: number): this; | ||
/** @inheritdoc */ | ||
setName(name: string): void; | ||
/** | ||
* @inheritDoc | ||
*/ | ||
setName(name: string): void; | ||
updateName(name: string): this; | ||
/** | ||
@@ -175,2 +187,8 @@ * @inheritDoc | ||
}; | ||
/** | ||
* Get the merged data for this span. | ||
* For now, this combines `data` and `attributes` together, | ||
* until eventually we can ingest `attributes` directly. | ||
*/ | ||
private _getData; | ||
} | ||
@@ -177,0 +195,0 @@ export type SpanStatusType = |
@@ -1,4 +0,3 @@ | ||
import { TransactionContext } from '@sentry/types'; | ||
import { Span, TransactionContext } from '@sentry/types'; | ||
import { tracingContextFromHeaders } from '@sentry/utils'; | ||
import { Span } from './span'; | ||
/** | ||
@@ -15,2 +14,4 @@ * Wraps a function with a transaction/span and finishes the span after the function is done. | ||
* @private | ||
* | ||
* @deprecated Use `startSpan` instead. | ||
*/ | ||
@@ -36,3 +37,3 @@ export declare function trace<T>(context: TransactionContext, callback: (span?: Span) => T, onError?: (error: unknown, span?: Span) => void, afterFinish?: () => void): T; | ||
* Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span | ||
* after the function is done automatically. | ||
* after the function is done automatically. You'll have to call `span.end()` manually. | ||
* | ||
@@ -39,0 +40,0 @@ * The created span is the active span and will be used as parent by other spans created inside the function |
@@ -25,8 +25,14 @@ import { Context, DynamicSamplingContext, MeasurementUnit, Transaction as TransactionInterface, TransactionContext, TransactionEvent, TransactionMetadata } from '@sentry/types'; | ||
/*Getter for `name` property | ||
Setter for `name` property, which also sets `source` as custom */ | ||
* Setter for `name` property, which also sets `source` as custom. | ||
*/ | ||
name: string; | ||
/** | ||
* JSDoc | ||
* Setter for `name` property, which also sets `source` on the metadata. | ||
* | ||
* @deprecated Use `updateName()` and `setMetadata()` instead. | ||
*/ | ||
setName(name: string, source?: TransactionMetadata['source']): void; | ||
/** @inheritdoc */ | ||
updateName(name: string): this; | ||
/** | ||
@@ -33,0 +39,0 @@ * Attaches SpanRecorder to the span itself |
@@ -1,2 +0,2 @@ | ||
export declare const SDK_VERSION = "7.91.0"; | ||
export declare const SDK_VERSION = "7.92.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -156,2 +156,3 @@ import type { Breadcrumb, BreadcrumbHint, CaptureContext, CheckIn, Client, CustomSamplingContext, Event, EventHint, Extra, Extras, MonitorConfig, Primitive, Severity, SeverityLevel, TransactionContext, User } from '@sentry/types'; | ||
* @returns The last event id of a captured event. | ||
* @deprecated This function will be removed in the next major version of the Sentry SDK. | ||
*/ | ||
@@ -158,0 +159,0 @@ export declare function lastEventId(): string | undefined; |
@@ -29,2 +29,4 @@ export type { ClientClass } from './sdk'; | ||
export { isSentryRequestUrl } from './utils/isSentryRequestUrl'; | ||
export { handleCallbackErrors } from './utils/handleCallbackErrors'; | ||
export { spanToTraceHeader } from './utils/spanUtils'; | ||
export { DEFAULT_ENVIRONMENT } from './constants'; | ||
@@ -31,0 +33,0 @@ export { ModuleMetadata } from './integrations/metadata'; |
@@ -31,3 +31,3 @@ import type { Client, EventProcessor, Hub, Integration, IntegrationFn, Options } from '@sentry/types'; | ||
*/ | ||
export declare function convertIntegrationFnToClass<Fn extends IntegrationFn>(name: string, fn: Fn): { | ||
export declare function convertIntegrationFnToClass<Fn extends IntegrationFn>(name: string, fn: Fn): Integration & { | ||
id: string; | ||
@@ -34,0 +34,0 @@ new (...args: Parameters<Fn>): Integration & ReturnType<Fn> & { |
/** Patch toString calls to return proper name for wrapped functions */ | ||
export declare const FunctionToString: { | ||
export declare const FunctionToString: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -4,0 +4,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -12,3 +12,3 @@ /** Options for the InboundFilters integration */ | ||
/** Inbound filters configurable by the user */ | ||
export declare const InboundFilters: { | ||
export declare const InboundFilters: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -15,0 +15,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
/** Adds SDK info to an event. */ | ||
export declare const LinkedErrors: { | ||
export declare const LinkedErrors: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -4,0 +4,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -10,3 +10,3 @@ /** | ||
*/ | ||
export declare const ModuleMetadata: { | ||
export declare const ModuleMetadata: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -13,0 +13,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -24,3 +24,3 @@ import type { TransactionNamingScheme } from '@sentry/utils'; | ||
* so it can be used in cross-platform SDKs like `@sentry/nextjs`. */ | ||
export declare const RequestData: { | ||
export declare const RequestData: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -27,0 +27,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -36,3 +36,3 @@ import type { MeasurementUnit, Primitive } from '@sentry/types'; | ||
gauge: typeof gauge; | ||
MetricsAggregator: { | ||
MetricsAggregator: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -39,0 +39,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -6,3 +6,3 @@ /** | ||
*/ | ||
export declare const MetricsAggregator: { | ||
export declare const MetricsAggregator: import("@sentry/types").Integration & { | ||
new (...args: any[]): import("@sentry/types").Integration & import("@sentry/types").IntegrationFnResult & { | ||
@@ -9,0 +9,0 @@ setupOnce: (addGlobalEventProcessor?: ((callback: import("@sentry/types").EventProcessor) => void) | undefined, getCurrentHub?: (() => import("@sentry/types").Hub) | undefined) => void; |
@@ -1,2 +0,2 @@ | ||
import type { Attachment, Breadcrumb, CaptureContext, Context, Contexts, Event, EventHint, EventProcessor, Extra, Extras, Primitive, PropagationContext, RequestSession, Scope as ScopeInterface, ScopeData, Session, Severity, SeverityLevel, Span, Transaction, User } from '@sentry/types'; | ||
import type { Attachment, Breadcrumb, CaptureContext, Client, Context, Contexts, Event, EventHint, EventProcessor, Extra, Extras, Primitive, PropagationContext, RequestSession, Scope as ScopeInterface, ScopeData, Session, Severity, SeverityLevel, Span, Transaction, User } from '@sentry/types'; | ||
/** | ||
@@ -48,2 +48,4 @@ * Holds additional event information. {@link Scope.applyToEvent} will be | ||
protected _requestSession?: RequestSession; | ||
/** The client on this scope */ | ||
protected _client?: Client; | ||
constructor(); | ||
@@ -59,3 +61,11 @@ /** | ||
clone(): Scope; | ||
/** Update the client on the scope. */ | ||
setClient(client: Client | undefined): void; | ||
/** | ||
* Get the client assigned to this scope. | ||
* | ||
* It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing. | ||
*/ | ||
getClient(): Client | undefined; | ||
/** | ||
* Add internal on change listener. Used for sub SDKs that need to store the scope. | ||
@@ -62,0 +72,0 @@ * @hidden |
@@ -1,2 +0,2 @@ | ||
import type { Instrumenter, Primitive, Span as SpanInterface, SpanContext, SpanOrigin, TraceContext, Transaction } from '@sentry/types'; | ||
import type { Instrumenter, Primitive, Span as SpanInterface, SpanAttributeValue, SpanAttributes, SpanContext, SpanOrigin, TraceContext, Transaction } from '@sentry/types'; | ||
/** | ||
@@ -73,2 +73,6 @@ * Keeps track of finished spans for a given transaction | ||
/** | ||
* @inheritDoc | ||
*/ | ||
attributes: SpanAttributes; | ||
/** | ||
* List of spans that were finalized | ||
@@ -99,3 +103,5 @@ */ | ||
get name(): string; | ||
/** Update the name of the span. */ | ||
/** | ||
* Update the name of the span. | ||
*/ | ||
set name(name: string); | ||
@@ -114,2 +120,6 @@ /** | ||
setData(key: string, value: any): this; | ||
/** @inheritdoc */ | ||
setAttribute(key: string, value: SpanAttributeValue | undefined): void; | ||
/** @inheritdoc */ | ||
setAttributes(attributes: SpanAttributes): void; | ||
/** | ||
@@ -123,6 +133,8 @@ * @inheritDoc | ||
setHttpStatus(httpStatus: number): this; | ||
/** @inheritdoc */ | ||
setName(name: string): void; | ||
/** | ||
* @inheritDoc | ||
*/ | ||
setName(name: string): void; | ||
updateName(name: string): this; | ||
/** | ||
@@ -176,2 +188,8 @@ * @inheritDoc | ||
}; | ||
/** | ||
* Get the merged data for this span. | ||
* For now, this combines `data` and `attributes` together, | ||
* until eventually we can ingest `attributes` directly. | ||
*/ | ||
private _getData; | ||
} | ||
@@ -178,0 +196,0 @@ export type SpanStatusType = |
@@ -1,4 +0,3 @@ | ||
import type { TransactionContext } from '@sentry/types'; | ||
import type { Span, TransactionContext } from '@sentry/types'; | ||
import { tracingContextFromHeaders } from '@sentry/utils'; | ||
import type { Span } from './span'; | ||
/** | ||
@@ -15,2 +14,4 @@ * Wraps a function with a transaction/span and finishes the span after the function is done. | ||
* @private | ||
* | ||
* @deprecated Use `startSpan` instead. | ||
*/ | ||
@@ -36,3 +37,3 @@ export declare function trace<T>(context: TransactionContext, callback: (span?: Span) => T, onError?: (error: unknown, span?: Span) => void, afterFinish?: () => void): T; | ||
* Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span | ||
* after the function is done automatically. | ||
* after the function is done automatically. You'll have to call `span.end()` manually. | ||
* | ||
@@ -39,0 +40,0 @@ * The created span is the active span and will be used as parent by other spans created inside the function |
@@ -26,8 +26,14 @@ import type { Context, DynamicSamplingContext, MeasurementUnit, Transaction as TransactionInterface, TransactionContext, TransactionEvent, TransactionMetadata } from '@sentry/types'; | ||
get name(): string; | ||
/** Setter for `name` property, which also sets `source` as custom */ | ||
/** | ||
* Setter for `name` property, which also sets `source` as custom. | ||
*/ | ||
set name(newName: string); | ||
/** | ||
* JSDoc | ||
* Setter for `name` property, which also sets `source` on the metadata. | ||
* | ||
* @deprecated Use `updateName()` and `setMetadata()` instead. | ||
*/ | ||
setName(name: string, source?: TransactionMetadata['source']): void; | ||
/** @inheritdoc */ | ||
updateName(name: string): this; | ||
/** | ||
@@ -34,0 +40,0 @@ * Attaches SpanRecorder to the span itself |
@@ -1,2 +0,2 @@ | ||
export declare const SDK_VERSION = "7.91.0"; | ||
export declare const SDK_VERSION = "7.92.0"; | ||
//# sourceMappingURL=version.d.ts.map |
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
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
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
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
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
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
1531073
373
17733
+ Added@sentry/types@7.92.0(transitive)
+ Added@sentry/utils@7.92.0(transitive)
- Removed@sentry/types@7.91.0(transitive)
- Removed@sentry/utils@7.91.0(transitive)
Updated@sentry/types@7.92.0
Updated@sentry/utils@7.92.0