Skip to content

[api] Fix Tracer.StartRootSpan so that it always creates a root span - #4890

Merged
CodeBlanch merged 5 commits into
open-telemetry:mainfrom
CodeBlanch:api-tracer-startrootspan-fix
Sep 29, 2023
Merged

[api] Fix Tracer.StartRootSpan so that it always creates a root span#4890
CodeBlanch merged 5 commits into
open-telemetry:mainfrom
CodeBlanch:api-tracer-startrootspan-fix

Conversation

@CodeBlanch

@CodeBlanch CodeBlanch commented Sep 26, 2023

Copy link
Copy Markdown
Member

Fixes #2803

Changes

  • Fix Tracer.StartRootSpan so that it creates a root span even if Activity.Current != null

Merge requirement checklist

  • CONTRIBUTING guidelines followed (nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes

@CodeBlanch
CodeBlanch requested a review from a team September 26, 2023 21:48
@CodeBlanch CodeBlanch added the pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package label Sep 26, 2023
@reyang

reyang commented Sep 26, 2023

Copy link
Copy Markdown
Member

Related to dotnet/runtime#65528.

@codecov

codecov Bot commented Sep 26, 2023

Copy link
Copy Markdown

Codecov Report

Merging #4890 (b447a51) into main (043272e) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4890      +/-   ##
==========================================
- Coverage   82.94%   82.93%   -0.01%     
==========================================
  Files         294      294              
  Lines       12200    12206       +6     
==========================================
+ Hits        10119    10123       +4     
- Misses       2081     2083       +2     
Flag Coverage Δ
unittests 82.93% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/OpenTelemetry.Api/Trace/Tracer.cs 92.50% <100.00%> (+4.26%) ⬆️

... and 7 files with indirect coverage changes

@pjanotti pjanotti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/OpenTelemetry.Api/Trace/Tracer.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Start Root Span Collects Current Active Span as Parent

3 participants