Skip to content

Commit

Permalink
misc(sentry): tag protocol method (#12268)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored and paulirish committed Mar 23, 2021
1 parent 31370c1 commit b9ce737
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lighthouse-core/lib/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ function init(opts) {
const sampledErrorMatch = SAMPLED_ERRORS.find(sample => sample.pattern.test(err.message));
if (sampledErrorMatch && sampledErrorMatch.rate <= Math.random()) return;

// Protocol errors all share same stack trace, so add more to fingerprint
// @ts-expect-error - properties added to protocol method LHErrors.
if (err.protocolMethod) {
// Protocol errors all share same stack trace, so add more to fingerprint
// @ts-expect-error - properties added to protocol method LHErrors.
opts.fingerprint = ['{{ default }}', err.protocolMethod, err.protocolError];

opts.tags = opts.tags || {};
// @ts-expect-error - properties added to protocol method LHErrors.
opts.tags.protocolMethod = err.protocolMethod;
}

return new Promise(resolve => {
Expand Down

0 comments on commit b9ce737

Please sign in to comment.