chanzuckerberg / napari-hub

Discover, install, and share napari plugins
MIT License
51 stars 18 forks source link

add metric filter for RUM uncaught errors #1287

Closed codemonkey800 closed 1 year ago

codemonkey800 commented 1 year ago

Description

Adds a metric filter for RUM error events so that the uncaught error doesn't get triggered for errors that we can safely ignore.

Demos

The pattern for the filter can be verified using the AWS cli:

AWS_PROFILE=sci-imaging aws logs describe-metric-filters \
  | jq --raw-output '.metricFilters[] | select(.filterName=="dev-shared-frontend-uncaught-error") | .filterPattern'
"com.amazon.rum.js_error_event" -"CWR: Failed to retrieve Cognito identity" -"CWR: Failed to retrieve credentials" -"ResizeObserver loop" -"Script error" -"The provided `href`" -"The request is not allowed by the user agent"

Tested in dev-shared with artificial errors created from the frontend:

image

The first 3 buttons are all known errors that are filtered while the last one is not. Clicking on any of the first 3 buttons correctly reports in RUM:

image

But it does not trigger the alert. However, clicking on the last button will trigger the alert:

image image
github-actions[bot] commented 1 year ago

This PR has been included in release: v23.10.2, see the release notes.