feat: Allow override of domain metadata attribute #453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #430, we propose allowing all metadata attributes to be overridden. The primary motivation for this change is to work around the fact that CloudWatch RUM does not currently support associating multiple domains with an app monitor. Specifically, by allowing applications to overwrite the domain read from
window.location
, the application can spoof the domain and pass the domain check in CloudWatch RUM.However, allowing all metadata attributes to be overridden could make it more difficult to provide backwards compatibility in the future, or cause users pain if they accidentally override a built-in metadata value.
For example, if the user agent is parsed by the service, instead of here, the service may choose overwrite the metadata values provided in the request. A counter argument is that allowing metadata attributes to be overridden makes it easier for applications to set values in cases where the built-in metadata values are incorrect.
Instead, this change allows only the domain attribute to be overridden.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.