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: Allowed undici error reporting to be disabled with feature flag undici_error_tracking #2956

Merged
merged 4 commits into from
Feb 20, 2025

Conversation

Voziv
Copy link
Contributor

@Voziv Voziv commented Feb 20, 2025

Description

When fetch in node 20+ is wrapped in a try/catch the error that is thrown even if the user doesn't rethrow the error. At best this means errors being reported that are not errors, at worst it means errors are being reported twice.

This adds the feature flag undici_error_tracking as suggested by @bizob2828 to allow disabling error capture via undici message channels.

How to Test

See test in the files changed. I've caught an undici error and ensured that when the flag is turned off the transaction error array is empty.

Related Issues

Fixes #2954

@CLAassistant
Copy link

CLAassistant commented Feb 20, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@bizob2828 bizob2828 self-assigned this Feb 20, 2025
Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

Looks good. I'm going to commit a documentation update and test tweak but thanks for adding @Voziv !

Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

i cannot push to your branch, so i suggested a change and I'll follow up with doc update

@bizob2828 bizob2828 changed the title feat: allow undici error reporting to be disabled feat: allow undici error reporting to be disabled with feature flag undici_error_tracking Feb 20, 2025
@bizob2828 bizob2828 changed the title feat: allow undici error reporting to be disabled with feature flag undici_error_tracking feat: Allowed undici error reporting to be disabled with feature flag undici_error_tracking Feb 20, 2025
Co-authored-by: Bob Evans <robert.evans25@gmail.com>
@Voziv Voziv requested a review from bizob2828 February 20, 2025 18:58
Copy link
Member

@bizob2828 bizob2828 left a comment

Choose a reason for hiding this comment

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

thanks for handling the back and forth @Voziv, LGTM. Just a heads up, we will probably release this next week.

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.30%. Comparing base (bc714cf) to head (6db3786).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2956      +/-   ##
==========================================
- Coverage   97.35%   97.30%   -0.05%     
==========================================
  Files         317      317              
  Lines       48690    48692       +2     
==========================================
- Hits        47402    47382      -20     
- Misses       1288     1310      +22     
Flag Coverage Δ
integration-tests-cjs-18.x 72.34% <100.00%> (+<0.01%) ⬆️
integration-tests-cjs-20.x 72.34% <100.00%> (+<0.01%) ⬆️
integration-tests-cjs-22.x 72.55% <100.00%> (-0.01%) ⬇️
integration-tests-esm-18.x 49.96% <50.00%> (ø)
integration-tests-esm-20.x 49.97% <50.00%> (+<0.01%) ⬆️
integration-tests-esm-22.x 50.02% <50.00%> (ø)
unit-tests-18.x 89.03% <100.00%> (+<0.01%) ⬆️
unit-tests-20.x 89.03% <100.00%> (+<0.01%) ⬆️
unit-tests-22.x 89.03% <100.00%> (+<0.01%) ⬆️
versioned-tests-18.x 79.58% <100.00%> (-0.19%) ⬇️
versioned-tests-20.x 79.58% <100.00%> (-0.19%) ⬇️
versioned-tests-22.x 79.59% <100.00%> (-0.19%) ⬇️

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 6278107 into newrelic:main Feb 20, 2025
26 of 27 checks passed
@github-actions github-actions bot mentioned this pull request Mar 3, 2025
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.

Undici are always reported even when caught with a try/catch
3 participants