Skip to content

[API] Create root span with active span#2427

Merged
marcalff merged 11 commits into
open-telemetry:mainfrom
lalitb:root-active-span
Dec 5, 2023
Merged

[API] Create root span with active span#2427
marcalff merged 11 commits into
open-telemetry:mainfrom
lalitb:root-active-span

Conversation

@lalitb

@lalitb lalitb commented Dec 4, 2023

Copy link
Copy Markdown
Member

Fixes #2413

Changes

A safe ABIv1 approach (non-ABI/non-API breaking) I can think of - passing Context with ("is_root_span", true) value.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team December 4, 2023 19:48
@lalitb lalitb changed the title [For discussion] Create root span when active span is active [For discussion] Create root span when active span Dec 4, 2023
@lalitb lalitb changed the title [For discussion] Create root span when active span [For discussion] Create root span with active span Dec 4, 2023
@codecov

codecov Bot commented Dec 4, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2427 (e044771) into main (d91e5ba) will decrease coverage by 0.00%.
The diff coverage is 85.72%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2427      +/-   ##
==========================================
- Coverage   87.06%   87.06%   -0.00%     
==========================================
  Files         199      199              
  Lines        6080     6087       +7     
==========================================
+ Hits         5293     5299       +6     
- Misses        787      788       +1     
Files Coverage Δ
sdk/src/trace/tracer.cc 80.00% <100.00%> (+0.84%) ⬆️
api/include/opentelemetry/trace/context.h 91.67% <80.00%> (-8.33%) ⬇️

@marcalff

marcalff commented Dec 4, 2023

Copy link
Copy Markdown
Member

As discussed in SIG meeting, the fix principle looks ok.
The doc (comments) will need to detail how to create a root span.

@marcalff marcalff mentioned this pull request Dec 4, 2023
@lalitb lalitb changed the title [For discussion] Create root span with active span Create root span with active span Dec 5, 2023

@marcalff marcalff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just one suggestion.

Nice trick to have the fix in ABIv1.

Comment thread sdk/test/trace/tracer_test.cc
@marcalff marcalff changed the title Create root span with active span [API] Create root span with active span Dec 5, 2023
@marcalff marcalff merged commit 48e633e into open-telemetry:main Dec 5, 2023
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.

Ability to create a root span (span with no parent) when another span is active.

2 participants