@sentry/core
Advanced tools
Comparing version 7.118.0 to 7.119.0
@@ -361,6 +361,8 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
*/ | ||
recordDroppedEvent(reason, category, _event) { | ||
// Note: we use `event` in replay, where we overwrite this hook. | ||
recordDroppedEvent(reason, category, eventOrCount) { | ||
if (this._options.sendClientReports) { | ||
// TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload | ||
// If event is passed as third argument, we assume this is a count of 1 | ||
const count = typeof eventOrCount === 'number' ? eventOrCount : 1; | ||
if (this._options.sendClientReports) { | ||
// We want to track each category (error, transaction, session, replay_event) separately | ||
@@ -373,6 +375,4 @@ // but still keep the distinction between different type of outcomes. | ||
const key = `${reason}:${category}`; | ||
debugBuild.DEBUG_BUILD && utils.logger.log(`Adding outcome: "${key}"`); | ||
// The following works because undefined + 1 === NaN and NaN is falsy | ||
this._outcomes[key] = this._outcomes[key] + 1 || 1; | ||
debugBuild.DEBUG_BUILD && utils.logger.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ''}`); | ||
this._outcomes[key] = (this._outcomes[key] || 0) + count; | ||
} | ||
@@ -648,2 +648,8 @@ } | ||
this.recordDroppedEvent('before_send', dataCategory, event); | ||
if (isTransaction) { | ||
const spans = event.spans || []; | ||
// the transaction itself counts as one span, plus all the child spans that are added | ||
const spanCount = 1 + spans.length; | ||
this.recordDroppedEvent('before_send', 'span', spanCount); | ||
} | ||
throw new utils.SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log'); | ||
@@ -657,2 +663,14 @@ } | ||
if (isTransaction) { | ||
const spanCountBefore = | ||
(processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) || | ||
0; | ||
const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; | ||
const droppedSpanCount = spanCountBefore - spanCountAfter; | ||
if (droppedSpanCount > 0) { | ||
this.recordDroppedEvent('before_send', 'span', droppedSpanCount); | ||
} | ||
} | ||
// None of the Sentry built event processor will update transaction name, | ||
@@ -786,2 +804,11 @@ // so if the transaction name has been changed by an event processor, we know | ||
if (isTransactionEvent(event) && beforeSendTransaction) { | ||
if (event.spans) { | ||
// We store the # of spans before processing in SDK metadata, | ||
// so we can compare it afterwards to determine how many spans were dropped | ||
const spanCountBefore = event.spans.length; | ||
event.sdkProcessingMetadata = { | ||
...event.sdkProcessingMetadata, | ||
spanCountBeforeProcessing: spanCountBefore, | ||
}; | ||
} | ||
return beforeSendTransaction(event, hint); | ||
@@ -788,0 +815,0 @@ } |
Object.defineProperty(exports, '__esModule', { value: true }); | ||
const SDK_VERSION = '7.118.0'; | ||
const SDK_VERSION = '7.119.0'; | ||
exports.SDK_VERSION = SDK_VERSION; | ||
//# sourceMappingURL=version.js.map |
@@ -359,6 +359,8 @@ import { makeDsn, logger, checkOrSetAlreadyCaught, isParameterizedString, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, rejectedSyncPromise, SentryError, isThenable, isPlainObject } from '@sentry/utils'; | ||
*/ | ||
recordDroppedEvent(reason, category, _event) { | ||
// Note: we use `event` in replay, where we overwrite this hook. | ||
recordDroppedEvent(reason, category, eventOrCount) { | ||
if (this._options.sendClientReports) { | ||
// TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload | ||
// If event is passed as third argument, we assume this is a count of 1 | ||
const count = typeof eventOrCount === 'number' ? eventOrCount : 1; | ||
if (this._options.sendClientReports) { | ||
// We want to track each category (error, transaction, session, replay_event) separately | ||
@@ -371,6 +373,4 @@ // but still keep the distinction between different type of outcomes. | ||
const key = `${reason}:${category}`; | ||
DEBUG_BUILD && logger.log(`Adding outcome: "${key}"`); | ||
// The following works because undefined + 1 === NaN and NaN is falsy | ||
this._outcomes[key] = this._outcomes[key] + 1 || 1; | ||
DEBUG_BUILD && logger.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ''}`); | ||
this._outcomes[key] = (this._outcomes[key] || 0) + count; | ||
} | ||
@@ -646,2 +646,8 @@ } | ||
this.recordDroppedEvent('before_send', dataCategory, event); | ||
if (isTransaction) { | ||
const spans = event.spans || []; | ||
// the transaction itself counts as one span, plus all the child spans that are added | ||
const spanCount = 1 + spans.length; | ||
this.recordDroppedEvent('before_send', 'span', spanCount); | ||
} | ||
throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log'); | ||
@@ -655,2 +661,14 @@ } | ||
if (isTransaction) { | ||
const spanCountBefore = | ||
(processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) || | ||
0; | ||
const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0; | ||
const droppedSpanCount = spanCountBefore - spanCountAfter; | ||
if (droppedSpanCount > 0) { | ||
this.recordDroppedEvent('before_send', 'span', droppedSpanCount); | ||
} | ||
} | ||
// None of the Sentry built event processor will update transaction name, | ||
@@ -784,2 +802,11 @@ // so if the transaction name has been changed by an event processor, we know | ||
if (isTransactionEvent(event) && beforeSendTransaction) { | ||
if (event.spans) { | ||
// We store the # of spans before processing in SDK metadata, | ||
// so we can compare it afterwards to determine how many spans were dropped | ||
const spanCountBefore = event.spans.length; | ||
event.sdkProcessingMetadata = { | ||
...event.sdkProcessingMetadata, | ||
spanCountBeforeProcessing: spanCountBefore, | ||
}; | ||
} | ||
return beforeSendTransaction(event, hint); | ||
@@ -786,0 +813,0 @@ } |
@@ -1,4 +0,4 @@ | ||
const SDK_VERSION = '7.118.0'; | ||
const SDK_VERSION = '7.119.0'; | ||
export { SDK_VERSION }; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@sentry/core", | ||
"version": "7.118.0", | ||
"version": "7.119.0", | ||
"description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -33,4 +33,4 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/types": "7.118.0", | ||
"@sentry/utils": "7.118.0" | ||
"@sentry/types": "7.119.0", | ||
"@sentry/utils": "7.119.0" | ||
}, | ||
@@ -37,0 +37,0 @@ "madge": { |
@@ -149,3 +149,3 @@ import { Breadcrumb, BreadcrumbHint, Client, ClientOptions, DataCategory, DsnComponents, DynamicSamplingContext, Envelope, Event, EventDropReason, EventHint, EventProcessor, FeedbackEvent, Integration, IntegrationClass, MetricBucketItem, MetricsAggregator, Outcome, ParameterizedString, SdkMetadata, Session, SessionAggregates, Severity, SeverityLevel, StartSpanOptions, Transaction, Transport, TransportMakeRequestResponse } from '@sentry/types'; | ||
*/ | ||
recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void; | ||
recordDroppedEvent(reason: EventDropReason, category: DataCategory, eventOrCount?: Event | number): void; | ||
/** | ||
@@ -152,0 +152,0 @@ * @inheritDoc |
@@ -1,2 +0,2 @@ | ||
export declare const SDK_VERSION = "7.118.0"; | ||
export declare const SDK_VERSION = "7.119.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -149,3 +149,3 @@ import type { Breadcrumb, BreadcrumbHint, Client, ClientOptions, DataCategory, DsnComponents, DynamicSamplingContext, Envelope, Event, EventDropReason, EventHint, EventProcessor, FeedbackEvent, Integration, IntegrationClass, MetricBucketItem, MetricsAggregator, Outcome, ParameterizedString, SdkMetadata, Session, SessionAggregates, Severity, SeverityLevel, StartSpanOptions, Transaction, Transport, TransportMakeRequestResponse } from '@sentry/types'; | ||
*/ | ||
recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void; | ||
recordDroppedEvent(reason: EventDropReason, category: DataCategory, eventOrCount?: Event | number): void; | ||
/** | ||
@@ -152,0 +152,0 @@ * @inheritDoc |
@@ -1,2 +0,2 @@ | ||
export declare const SDK_VERSION = "7.118.0"; | ||
export declare const SDK_VERSION = "7.119.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
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
1924977
22061
+ Added@sentry/types@7.119.0(transitive)
+ Added@sentry/utils@7.119.0(transitive)
- Removed@sentry/types@7.118.0(transitive)
- Removed@sentry/utils@7.118.0(transitive)
Updated@sentry/types@7.119.0
Updated@sentry/utils@7.119.0