aws-observability / aws-rum-web

Amazon CloudWatch RUM Web Client
Apache License 2.0
114 stars 65 forks source link

[Feature Request]: Easier error ignore function #545

Open wedoogift-jenkins opened 2 months ago

wedoogift-jenkins commented 2 months ago

Please provide your feature request

Hi,

Currently, the ignore function of the 'errors' telemetry takes the raw error event as an argument to let the developer choose whether to ignore it or not. However, this is not consistent with the way the error is reported back to the AWS RUM console as several transformations are applied to the error object to produce the event sent to RUM.

It makes adjusting the ignore function quite tricky only using the RUM console.

Wouldn't it easier to provide an alternative function that can filter the event based on the transformed data? It would even allow the developer to filter based on the metadata aws rum adds to the event (like the web browser, the user id, the session, etc.)

Thanks.

williazz commented 5 days ago

That's a great idea and would also address a lot of concerns for data scrubbing. For example: https://docs.sentry.io/security-legal-pii/scrubbing/

The feature would be a catch-all callback invoked on every raw rum event.

  1. The scrubber could transform any data before the events are loaded onto a batched PutRumEvents call
  2. The scrubber could also choose to drop any singular event if previous ignore functions failed. Obviously, previous ignore functions are still preferred to save the web client from doing unnecessary work.