-
Notifications
You must be signed in to change notification settings - Fork 765
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
Add isRemote check for context propagation #3329
Add isRemote check for context propagation #3329
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3329 +/- ##
==========================================
- Coverage 85.44% 85.27% -0.17%
==========================================
Files 270 270
Lines 9561 9561
==========================================
- Hits 8169 8153 -16
- Misses 1392 1408 +16
|
{ | ||
var isRootSpan = traceId == default; | ||
var isRootSpan = traceId == default || isParentRemote; |
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.
This is semantically buggy, I guess?
Maybe:
var isRootSpan = traceId == default;
return isRootSpan || isParentRemote
? ...
src/OpenTelemetry/CHANGELOG.md
Outdated
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Included `isRemote` check in `PropagateOrIgnoreData` in `TracerProviderSDK` to |
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.
TracerProvider modified to create activity irrespective of SamplingResult, for spans with Remote Parent, to maintain context propagation.
^ or similar wording.
@vishweshbankwar will hold off from merging for a day, as we are doing 1.3.0 stable release, and want to avoid any functional changes. |
@vishweshbankwar Please fix the conflict, and we are good to go |
} | ||
|
||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
private static ActivitySamplingResult PropagateOrIgnoreData(ActivityTraceId traceId) | ||
private static ActivitySamplingResult PropagateOrIgnoreData(ActivityTraceId traceId, bool isParentRemote) |
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.
We could probably explore updating the method signature here to something like this:
private static ActivitySamplingResult PropagateOrIgnoreData(in ActivityContext parentContext)
and pass in options.Parent
to this method. ActivityContext
is a readonly struct
so using the in
modifier might give some minor perf gains.
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.
Minor:
Method | Mean | Error | StdDev |
---|---|---|---|
WithoutInParam | 716.8 ns | 12.69 ns | 11.87 ns |
WithInparam | 676.5 ns | 7.27 ns | 6.44 ns |
I have updated the method signature
Fixes #3315
Changes
Please provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes