Skip to content
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

[Http] Fix propagation issues #3828

Merged
merged 14 commits into from
Oct 28, 2022

Conversation

CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented Oct 26, 2022

Changes

I was working on tests for #3793 and it seems we have a propagation bug:

  • On .NET 7 our new rule to exclude the legacy activity skips our propagation completely when span is not sampled.

What this change does is...

  • Restore that propagation always happens.

TODOs

  • Appropriate CHANGELOG.md updated for non-trivial changes

@CodeBlanch CodeBlanch requested a review from a team as a code owner October 26, 2022 21:24
@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #3828 (2cfd787) into main (1a65aec) will decrease coverage by 0.29%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3828      +/-   ##
==========================================
- Coverage   87.42%   87.13%   -0.30%     
==========================================
  Files         280      280              
  Lines       10767    10765       -2     
==========================================
- Hits         9413     9380      -33     
- Misses       1354     1385      +31     
Impacted Files Coverage Δ
...tp/Implementation/HttpHandlerDiagnosticListener.cs 73.68% <100.00%> (+0.48%) ⬆️
...entation/ExportClient/OtlpGrpcTraceExportClient.cs 35.71% <0.00%> (-42.86%) ⬇️
...xporter.OpenTelemetryProtocol/OtlpTraceExporter.cs 46.15% <0.00%> (-34.62%) ⬇️
src/OpenTelemetry/Logs/Pool/LogRecordSharedPool.cs 78.94% <0.00%> (-21.06%) ⬇️
...emetry.Api/Internal/OpenTelemetryApiEventSource.cs 73.52% <0.00%> (-8.83%) ⬇️
...metryProtocol/Implementation/ActivityExtensions.cs 91.89% <0.00%> (-4.33%) ⬇️
...Telemetry/Internal/SelfDiagnosticsEventListener.cs 97.65% <0.00%> (+0.78%) ⬆️
...Propagators/OpenTelemetryPropagatorsEventSource.cs 100.00% <0.00%> (+12.50%) ⬆️

}
else
{
Assert.Single(exportedItems);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For test case sample == true && createParentActivity == true shouldn't we expect nothing exported?

That is, the parent activity that is created is not sampled, right? So per the default ParentBasedSampler LocalParentNotSampled sampler defaults to AlwaysOff.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is, the parent activity that is created is not sampled, right?

It is fake sampled 🤣

   parent = new Activity("parent")
      .SetIdFormat(ActivityIdFormat.W3C)
      .Start();

   parent.TraceStateString = "k1=v1,k2=v2";
   parent.ActivityTraceFlags = ActivityTraceFlags.Recorded; // <- Here

@CodeBlanch CodeBlanch merged commit 8add3db into open-telemetry:main Oct 28, 2022
@CodeBlanch CodeBlanch deleted the http-propagation branch October 28, 2022 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants