-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RUMM-2713: Move global RUM context into generic feature context storage #1146
RUMM-2713: Move global RUM context into generic feature context storage #1146
Conversation
7cb8e6a
to
35ccaee
Compare
Codecov Report
@@ Coverage Diff @@
## feature/sdkv2 #1146 +/- ##
=================================================
+ Coverage 82.43% 82.50% +0.07%
=================================================
Files 350 350
Lines 11524 11559 +35
Branches 1957 1980 +23
=================================================
+ Hits 9499 9536 +37
+ Misses 1424 1419 -5
- Partials 601 604 +3
|
2d356b3
to
ad1cf8a
Compare
it.setFeatureContext(featureName, mutableContext) | ||
mutableContext | ||
} | ||
if (featureName == RumFeature.RUM_FEATURE_NAME) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we doing this only for the RUM
feature name ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because context which is received by DatadogPlugin
contains only RUM-related info, so it makes sense to update it only when RUM context is updated.
Anyway, DatadogPlugin
will be removed in v2. This code won't live long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
This change removes global RUM context from
GlobalRum
singleton by moving it to the feature's context (DatadogContext#featuresContext
).Now RUM context will be stored in the generic dictionary
Map<String, Any?>
and can be accessed either by callingDatadogContext#featuresContext
or by callingSdkCore#getFeatureContext
.Also
SdkCore#setFeatureContext
is removed in the favour ofSdkCore#updateFeatureContext
method which gives a mutable dictionary for the update, final update is thread-safe.Review checklist (to be filled by reviewers)