You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The problem we're facing is we'd like to enrich ViewEvents with custom attributes but additionalProperties can't be modified
The approach we're following is to set up EventMapper<ViewEvent> to get a callback when a ViewEvent is generated.
As it's known you can't clone the viewEvent or it will be discarded. So only a few var properties can be modified. The Context.additionalProperties is a map that looks like the right place to add extra properties but unfortunately is not mutable.
Describe alternatives you've considered
The alternative we've considered was to write a custom ViewTrackingStrategy that will create its own set of attributes to track, but it seems overkill for this
Additional context
Alternatively consider allowing the injection of custom rules on RumEventMapper regarding which events are dropped to, for example, allow events that are not the same instance (aka, allow .copy())
The text was updated successfully, but these errors were encountered:
Hi @lgvalle , thanks alot for this feature request. Indeed for now we don't allow modification of the additional properties, but we are considering adding some APIs to allow enriching the view.
You can also add custom attributes through the GlobalRum.addAttribute() (and similar methods).
Hello @lgvalle! ViewEvent.Context.additionalProperties is now mutable (it has the type MutableMap<String, Any?>, this change was done in #1089) and was delivered in the release 1.15.0.
I'm closing this issue as your request was implemented, don't hesitate to re-open it if needed.
Is your feature request related to a problem? Please describe.
The problem we're facing is we'd like to enrich ViewEvents with custom attributes but
additionalProperties
can't be modifiedThe approach we're following is to set up
EventMapper<ViewEvent>
to get a callback when aViewEvent
is generated.As it's known you can't clone the viewEvent or it will be discarded. So only a few
var
properties can be modified. TheContext.additionalProperties
is a map that looks like the right place to add extra properties but unfortunately is not mutable.Describe the solution you'd like
Change
to
or alternatively to
so extra properties can be added to ViewEvents
Describe alternatives you've considered
The alternative we've considered was to write a custom
ViewTrackingStrategy
that will create its own set ofattributes
to track, but it seems overkill for thisAdditional context
Alternatively consider allowing the injection of custom rules on
RumEventMapper
regarding which events are dropped to, for example, allow events that are not the same instance (aka, allow.copy()
)The text was updated successfully, but these errors were encountered: