Skip to content

Commit 3c21b90

Browse files
committed
log NormalizeDepth when normalization is skipped
1 parent b46674c commit 3c21b90

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/core/src/baseclient.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ export abstract class BaseClient<B extends Backend, O extends Options> implement
374374
}
375375

376376
return result.then(evt => {
377+
if (evt) {
378+
// TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809
379+
// it is only attached as extra data to the event if the event somehow skips being normalized
380+
evt.sdkProcessingMetadata = { ...evt.sdkProcessingMetadata, normalizeDepth: normalize(normalizeDepth) };
381+
}
377382
if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
378383
return this._normalizeEvent(evt, normalizeDepth);
379384
}

packages/core/src/request.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ export function eventToSentryRequest(event: Event, api: APIDetails): SentryReque
7373
event.extra = event.extra || {};
7474

7575
// In theory, all events should be marked as having gone through normalization and so
76-
// we should never set this tag
76+
// we should never set this tag/extra data
7777
if (!(event.sdkProcessingMetadata && event.sdkProcessingMetadata.baseClientNormalized)) {
7878
event.tags.skippedNormalization = true;
79+
event.extra.normalizeDepth = event.sdkProcessingMetadata ? event.sdkProcessingMetadata.normalizeDepth : 'unset';
7980
}
8081

8182
// prevent this data from being sent to sentry

0 commit comments

Comments
 (0)