Skip to content
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

add metric filter for RUM uncaught errors #1287

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

codemonkey800
Copy link
Collaborator

@codemonkey800 codemonkey800 commented Oct 17, 2023

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

@codemonkey800 codemonkey800 added the improvement Release Label: Used for categorizing improvements in automated CI release notes label Oct 17, 2023
@codemonkey800 codemonkey800 marked this pull request as ready for review October 17, 2023 16:45
Copy link
Collaborator

@manasaV3 manasaV3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@codemonkey800 codemonkey800 merged commit f5c4c45 into main Oct 19, 2023
3 checks passed
@codemonkey800 codemonkey800 deleted the jeremy/uncaught-error-metric-filter branch October 19, 2023 18:11
@github-actions
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Release Label: Used for categorizing improvements in automated CI release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants