-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(tsc): add type checking to sentry usage #5993
Conversation
lighthouse-core/lib/sentry.js
Outdated
{pattern: /No.*node with given id/, rate: 0.01}, | ||
{pattern: /Could not load stylesheet/, rate: 0.1}, | ||
{pattern: /No.*resource with given/, rate: 0.1}, | ||
{pattern: /No.*node with given id/, rate: 0.1}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could drop these completely? Also do they fire multiple times per run? We could fire once per audit instead (does sentry support adding a count payload and have a decent aggregation view of them?)
lighthouse-core/lib/sentry.js
Outdated
// Ignore expected errors | ||
if (err.expected) return empty; | ||
// Sample known errors that occur at a high frequency | ||
const sampledErrorMatch = SAMPLED_ERRORS.find(sample => sample.pattern.test(err.message)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we keep this block?
along with something like this above:
const SAMPLED_ERRORS = [
// Error code based sampling
// e.g.: {pattern: /No.*node with given id/, rate: 0.01},
];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There you go :P
type stuff and fonts look good! |
const sentryDelegate = Object.assign({}, sentryApi); | ||
sentryDelegate.init = function init(opts) { | ||
const sentryDelegate = { | ||
init, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol the hoist. a lil fancy for my tastes, but ok.. :)
long-standing TODO.
Also fixes #5971