Skip to content

Commit e820a81

Browse files
committed
feat: Show dropped event url in black/whitelist debug mode
1 parent e054f1f commit e820a81

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- [browser] feat: Show dropped event url in blacklistUrl/whitelistUrl debug mode
6+
- [browser] feat: Use better event description instead of event_id for user-facing logs
7+
38
## 4.0.0
49

510
This is the release of our new SDKs, `@sentry/browser`, `@sentry/node`. While there are too many changes to list for

packages/browser/src/integrations/breadcrumbs.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { API, getCurrentHub, logger } from '@sentry/core';
22
import { Integration, Severity } from '@sentry/types';
33
import { isFunction, isString } from '@sentry/utils/is';
4-
import { getGlobalObject, parseUrl } from '@sentry/utils/misc';
5-
import { getEventDescription } from '@sentry/utils/misc';
4+
import { getEventDescription, getGlobalObject, parseUrl } from '@sentry/utils/misc';
65
import { deserialize, fill } from '@sentry/utils/object';
76
import { safeJoin } from '@sentry/utils/string';
87
import { supportsBeacon, supportsHistory, supportsNativeFetch } from '@sentry/utils/supports';

packages/browser/src/integrations/inboundfilters.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { configureScope, logger } from '@sentry/core';
22
import { Integration, SentryEvent } from '@sentry/types';
33
import { isRegExp } from '@sentry/utils/is';
4-
import { BrowserOptions } from '../backend';
54
import { getEventDescription } from '@sentry/utils/misc';
5+
import { BrowserOptions } from '../backend';
66

77
// "Script error." is hard coded into browsers for errors that it can't read.
88
// this is the result of a script being pulled in from an external domain and CORS.
@@ -40,15 +40,25 @@ export class InboundFilters implements Integration {
4040
/** JSDoc */
4141
public shouldDropEvent(event: SentryEvent): boolean {
4242
if (this.isIgnoredError(event)) {
43-
logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\n Event: ${getEventDescription(event)}`);
43+
logger.warn(
44+
`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(event)}`,
45+
);
4446
return true;
4547
}
4648
if (this.isBlacklistedUrl(event)) {
47-
logger.warn(`Event dropped due to being matched by \`blacklistUrls\` option.\n Event: ${getEventDescription(event)}`);
49+
logger.warn(
50+
`Event dropped due to being matched by \`blacklistUrls\` option.\nEvent: ${getEventDescription(
51+
event,
52+
)}.\nUrl: ${this.getEventFilterUrl(event)}`,
53+
);
4854
return true;
4955
}
5056
if (!this.isWhitelistedUrl(event)) {
51-
logger.warn(`Event dropped due to not being matched by \`whitelistUrls\` option.\n Event: ${getEventDescription(event)}`);
57+
logger.warn(
58+
`Event dropped due to not being matched by \`whitelistUrls\` option.\nEvent: ${getEventDescription(
59+
event,
60+
)}.\nUrl: ${this.getEventFilterUrl(event)}`,
61+
);
5262
return true;
5363
}
5464
return false;

0 commit comments

Comments
 (0)