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

feat: Propagate agent root context when opentelemetry ROOT_CONTEXT is passed in to trace propagator. Added logic to handle properly naming and ending transactions for server spans. #2940

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

bizob2828
Copy link
Member

Description

This PR starts the groundwork to properly propagate trace context. For now it's just being used to propagate our root context instead of otel's root context. I also added logic to properly name server span transactions and reconcile the relevant segment attributes with tests. There is missing test coverage in the trace propagator which will be handled in #2662

Related Issues

Closes #2936

jsumners-nr
jsumners-nr previously approved these changes Feb 11, 2025
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 82.18623% with 44 lines in your changes missing coverage. Please review.

Project coverage is 97.30%. Comparing base (6832637) to head (006e431).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
lib/otel/trace-propagator.js 62.39% 44 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2940      +/-   ##
==========================================
+ Coverage   88.88%   97.30%   +8.41%     
==========================================
  Files         315      317       +2     
  Lines       48395    48619     +224     
==========================================
+ Hits        43018    47309    +4291     
+ Misses       5377     1310    -4067     
Flag Coverage Δ
integration-tests-cjs-18.x 72.35% <39.67%> (?)
integration-tests-cjs-20.x 72.35% <39.67%> (?)
integration-tests-cjs-22.x 72.58% <39.67%> (-0.14%) ⬇️
integration-tests-esm-18.x 49.95% <39.67%> (-0.05%) ⬇️
integration-tests-esm-20.x 49.95% <39.67%> (-0.05%) ⬇️
integration-tests-esm-22.x 50.01% <39.67%> (-0.05%) ⬇️
unit-tests-18.x 89.05% <58.29%> (?)
unit-tests-20.x 89.05% <58.29%> (?)
unit-tests-22.x 89.06% <58.29%> (?)
versioned-tests-18.x 79.49% <72.06%> (-0.24%) ⬇️
versioned-tests-20.x 79.49% <72.06%> (-0.24%) ⬇️
versioned-tests-22.x 79.50% <72.06%> (-0.24%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bizob2828 bizob2828 merged commit b85111c into newrelic:main Feb 11, 2025
26 of 27 checks passed
@bizob2828 bizob2828 deleted the otel-propagator branch February 11, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done: Issues recently completed
Development

Successfully merging this pull request may close these issues.

Propagate agent root context on entry spans
2 participants