aws-observability / aws-rum-web

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

feat: allow customization of default attributes #430

Closed jhackshaw closed 5 months ago

jhackshaw commented 11 months ago

Allow the customization of default attributes, excluding the platformType.

Primary use case is overriding the domain reported to RUM to facilitate using the same app monitor across different top-level domains which is not natively supported in RUM configuration.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

qhanam commented 10 months ago

I am generally in favor of this change, but want to call out a few risks related to overwriting default attributes:

  1. This may break the CloudWatch RUM console experience, which expects some values to be members of a set.
  2. This may break metrics created by CloudWatch RUM, which expects some values to be members of a set.
  3. Overwritten attributes will not be ingested if they fail CloudWatch RUM's validation steps.
  4. Overwriting the domain increases the risk that an app monitor will receive data from an application which it is not meant to monitor. Specifically, if the initialization script is copied and pasted from one app monitor into another.

While it is currently possible to make these mistakes, this change makes it easier to make these mistakes. The tradeoff is that it provides more flexibility for CloudWatch RUM users, especially where feature gaps exist such as for app monitors that monitor multiple top-level domains.

ps863 commented 5 months ago

question: where do we enforce the 10 custom attribute limit? Does changing default attributes count towards that limit?

Eg - I change all the default attributes. Can I add 10 more custom attributes?

qhanam commented 5 months ago

question: where do we enforce the 10 custom attribute limit? Does changing default attributes count towards that limit?

Eg - I change all the default attributes. Can I add 10 more custom attributes?

There is no change to the 10 custom attribute limit. Default attributes do not count towards the limit even if they are overwritten.

As far as I can tell, the web client does not enforce any limits. This is all done by the service.