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

fix(api): use active context as default in NoopTracer #3476

Merged
merged 7 commits into from
Dec 14, 2022

Conversation

Flarna
Copy link
Member

@Flarna Flarna commented Dec 7, 2022

Which problem is this PR solving?

API without SDK usecase (only proagator and context manager and maybe some instrumentations used) doesn't work is one relies on context manager.

Short description of the changes

To support the API without SDK use cast to forward a span context it's needed to fetch active context via ContextManager also in NoopTracer. Otherwise only direct passing of a context works but not if context.with() is used.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

added unittest

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

To support the API without SDK use cast to forward a span context it's needed
to fetch active context via ContextManager also in NoopTracer. Otherwise only
direct passing of a context works but not if context.with() is used.
@Flarna Flarna requested a review from a team December 7, 2022 14:54
api/CHANGELOG.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #3476 (85e008d) into main (263ee61) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3476      +/-   ##
==========================================
- Coverage   93.77%   93.76%   -0.02%     
==========================================
  Files         248      248              
  Lines        7567     7567              
  Branches     1580     1581       +1     
==========================================
- Hits         7096     7095       -1     
- Misses        471      472       +1     
Impacted Files Coverage Δ
api/src/trace/NoopTracer.ts 97.29% <100.00%> (ø)
...-trace-base/src/platform/node/RandomIdGenerator.ts 87.50% <0.00%> (-6.25%) ⬇️

api/CHANGELOG.md Outdated Show resolved Hide resolved
@dyladan dyladan added bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect labels Dec 7, 2022
@dyladan dyladan merged commit 2fb80eb into open-telemetry:main Dec 14, 2022
@Flarna Flarna deleted the propagation-only branch December 20, 2022 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants