[RUM-11854]: Proper support propagation of RUM context for automatic http tracing via baggage header#2904
Conversation
7c3f6b8 to
1645104
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2904 +/- ##
===========================================
- Coverage 70.94% 70.61% -0.34%
===========================================
Files 815 815
Lines 30013 30050 +37
Branches 5022 5142 +120
===========================================
- Hits 21292 21217 -75
- Misses 7336 7379 +43
- Partials 1385 1454 +69
🚀 New features to boost your workflow:
|
…tp tracing via baggage header
…ampling/DeterministicSampler.kt Co-authored-by: Nikita Ogorodnikov <[email protected]>
f52f6f3 to
dc89915
Compare
|
|
||
| private fun injectRumContext(builder: DatadogSpanBuilder) { | ||
| sdkCore?.getFeature(Feature.RUM_FEATURE_NAME) | ||
| ?.getContextFuture(withFeatureContexts = setOf(Feature.RUM_FEATURE_NAME)) |
There was a problem hiding this comment.
question: is there advantage for creating getContextFuture method instead of using withContext? Seems like we added a method to the core API just for a single use-case, where withContext can be used.
There was a problem hiding this comment.
This is what I've highlighted in DM: It's not being added to the public API. It's an internal method that accessible only through extension method.
The advantage of having a Future here is that it allows us to:
- Avoid reinventing the wheel with our own
CompletableFuture, which could lead to potential issues. The JavaFutureclass feels more stable. All required logic is also supported by Future. - Properly block the thread when the result is obtained.
There was a problem hiding this comment.
Yes, but then you need to do type-check for SdkFeature, because it is not a part of interface (which is for good).
The goal is to have a limited ways to work with context, to simplify the DevEx, like a single simple thing which do the stuff, otherwise we may create a problem of choice.
But I'm ok with having it like that, given it doesn't make it to the interface.
3da9feb to
98981e7
Compare
…tor for DatadogContext
98981e7 to
a8bb138
Compare
What does this PR do?
RUM contextin tracing feature that usesCoreTracerfor automatic tracing.RUM contextis being added in one single place and works for both custom tracing and automatic tracingReview checklist (to be filled by reviewers)