✨ [RUM-1016] allow to change "view.name" #2396
Merged
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.
Motivation
It would be very useful to be able to easily define the view.name field rather than letting datadog group the fields. This is the case, for example, if you have complex urls that datadog is unable to group :
Of these 6 urls, datadog groups them in the same way:
/?
, whereas in my application, the first three correspond to one type of page (regex :^/[\w\-\.]+_P[0-9]+C([0-9]+)[^/]*$
), and the last three to another (regex :^/([\w\-\.]+_[0-9]+)([^/]*)$
). I'd like to be able to name them explicitly.As explained in the documentation, currently the only way to change the name of a RUM view is to set
trackViewsManually
to true when initializing the SDK. You then need to calldatadogRum.startView
manually.On an application already in production, which already uses datadog for the RUM, this represents a major implementation change, and there may be differences in the way it works with the default, and therefore differences in the metrics.
To avoid these side effects, the aim would be to be able to define the name of a view without having to call the startView itself. We keep the native way of working, no need to make a custom implementation on the route.
My change is a proposal: I don't know why it's impossible to edit this field and I don't know exactly what the implications of this addition are.
Changes
Possibility to set
event.view.name
in thebeforeSend
callback :Testing
I have gone over the contributing documentation.