aws-observability / aws-rum-web

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

[Feature Request]: error-free session_count V.S. No. of sessions experienced error #540

Open ShawneeY opened 2 months ago

ShawneeY commented 2 months ago

error-free session_count

Currently the built-in metrics provided by RUM includes:

  1. SessionCount
  2. JsErrorCount

We are interested in knowing error-free session_count and No. of sessions experienced at least 1 JS error to accurately indicate system health.

No. of sessions experienced at least 1 JS error can be queried in CloudWatch Log insights:

fields @timestamp, @message
| filter event_type = 'com.amazon.rum.js_error_event'
| stats count_distinct(user_details.sessionId) by bin(5min)

Then, error-free session count can be deduced by SessionCount - ErrorSessionCount in the same periods.

However, it seems difficult to convert the above query to a metrics filter because session_id is added as a dimension but CloudWatch intentionally disallows publishing metrics with dimensions of more than 1000 unique values to prevent misuse.

Is it possible to inform:

  1. how to count error-free session ?
  2. OR add such metrics as one of RUM's built-in metric ?

Many thanks in advance.