Skip to content

refactor: Updated the reparenting logic for compact mode of partial traces to assign parent id to entry span#3768

Merged
bizob2828 merged 1 commit intonewrelic:mainfrom
bizob2828:fix-compact-reparenting
Feb 18, 2026
Merged

refactor: Updated the reparenting logic for compact mode of partial traces to assign parent id to entry span#3768
bizob2828 merged 1 commit intonewrelic:mainfrom
bizob2828:fix-compact-reparenting

Conversation

@bizob2828
Copy link
Member

Description

We didn't implement compact reparenting to the spec. For all retained spans, the parent id should be the entry span.
Our logic was only reparenting to entry span if it was an exit span.
This PR also updates the cross agent tests to exhibit this behavior and cleaned up the assertParentId to make more sense if it fails.

How to Test

node test/integration/distributed-tracing/core-tracing.test.js

Related Issues

Closes #3764

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.71%. Comparing base (8503d25) to head (7979763).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3768      +/-   ##
==========================================
- Coverage   97.89%   97.71%   -0.18%     
==========================================
  Files         454      453       -1     
  Lines       58749    58639     -110     
  Branches        1        1              
==========================================
- Hits        57512    57300     -212     
- Misses       1237     1339     +102     
Flag Coverage Δ
integration-tests-cjs-20.x 74.35% <100.00%> (+0.05%) ⬆️
integration-tests-cjs-22.x 74.38% <100.00%> (+0.04%) ⬆️
integration-tests-cjs-24.x 75.16% <100.00%> (+0.01%) ⬆️
integration-tests-esm-20.x 53.03% <55.55%> (+0.01%) ⬆️
integration-tests-esm-22.x 53.07% <55.55%> (+<0.01%) ⬆️
integration-tests-esm-24.x 54.22% <55.55%> (-0.03%) ⬇️
unit-tests-20.x 89.41% <100.00%> (-0.08%) ⬇️
unit-tests-22.x 89.43% <100.00%> (-0.08%) ⬇️
unit-tests-24.x 89.43% <100.00%> (-0.08%) ⬇️
versioned-tests-20.x 81.31% <55.55%> (-0.38%) ⬇️
versioned-tests-22.x 81.32% <55.55%> (-0.38%) ⬇️
versioned-tests-24.x 81.23% <55.55%> (-0.38%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bizob2828 bizob2828 merged commit 5196318 into newrelic:main Feb 18, 2026
26 of 27 checks passed
@bizob2828 bizob2828 deleted the fix-compact-reparenting branch February 18, 2026 21:27
@github-project-automation github-project-automation bot moved this from Needs PR Review to Done: Issues recently completed in Node.js Engineering Board Feb 18, 2026
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.

compact mode should reparent all spans to entry span

2 participants

Comments