aws-observability / aws-rum-web

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

[General Inquiry]: Should errors be limited by 'sessionEventLimit'? #480

Open mitchmcleod-ew opened 6 months ago

mitchmcleod-ew commented 6 months ago

What is your general inquiry?

I wasn't expecting the behaviour of errors not being recorded when a sessionEventLimit is not, got a bit caught out by it. Is there a reason for blanket preventing all events based on the limit, including errors?

Would be handy if this was configurable. Being able to still collect errors beyond when you may care about other events in the session.

williazz commented 6 months ago

The design was to limit cost to customers, but I agree that it's inconvenient.

Here is what I propose. Do you have any feedback?

const config: AwsRumConfig = {
    ...
    sessionEventLimitOverride: [
       // list of RUM event types   
       ['js-error', 0] // where zero removes the limit
       ['other-event', 5] // count against override limit before counting against overall sessionEventLimit
    ]
}
mitchmcleod-ew commented 6 months ago

Yeah ok, that makes sense.

Just thinking about it, it would be a huge win for us to be able to limit all of the individual event types, just as you have there. So that looks pretty much perfect to me.

williazz commented 6 months ago

Perfect, I'll see what I can do.

Out of curiosity, which other events were you thinking about using this configuration for?

mitchmcleod-ew commented 6 months ago

I would probably do something like this once this configuration is available.

const config: AwsRumConfig = {
    ...
    sessionEventLimitOverride: [
       ['js-error', 0],
       ['fetch', 0], // Assuming this is correct to capture all HTTP
       ['pageview', 20], // Allow viewing some of the user journey
       // Maybe other limits for performance events
    ]
}
williazz commented 4 months ago

There are several requirements for this to be closed out