Skip to content

fix(otlp-exporter-base): handle response error event #6412

Merged
pichlermarc merged 6 commits intoopen-telemetry:mainfrom
dynatrace-oss-contrib:fix/http-exporter-error-event
Feb 24, 2026
Merged

fix(otlp-exporter-base): handle response error event #6412
pichlermarc merged 6 commits intoopen-telemetry:mainfrom
dynatrace-oss-contrib:fix/http-exporter-error-event

Conversation

@pichlermarc
Copy link
Copy Markdown
Member

@pichlermarc pichlermarc commented Feb 16, 2026

Which problem is this PR solving?

See #6410, the error event on the response is unhandled, it may be triggered in certain cases, like the author describes. This PR fixes this by adding a test + handling the response. In these cases we should already have the headers, so I added handling for sucess/failure/retry based on that, even if the response was not fully received (since the response is not necessary to ensure the OTLP export remains functional)

Fixes #6410

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added unit tests

@pichlermarc pichlermarc requested a review from a team as a code owner February 16, 2026 11:14
@pichlermarc pichlermarc marked this pull request as draft February 16, 2026 11:14
@pichlermarc pichlermarc changed the title fix(otlp-exporter-base): handle fix(otlp-exporter-base): handle response error event Feb 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.68%. Comparing base (34e7d91) to head (83d96e2).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6412      +/-   ##
==========================================
+ Coverage   95.59%   95.68%   +0.09%     
==========================================
  Files         361      364       +3     
  Lines       11595    11782     +187     
  Branches     2683     2745      +62     
==========================================
+ Hits        11084    11274     +190     
+ Misses        511      508       -3     
Files with missing lines Coverage Δ
...xporter-base/src/transport/http-transport-utils.ts 94.91% <100.00%> (+0.68%) ⬆️

... and 10 files with indirect coverage changes

🚀 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.

@pichlermarc pichlermarc force-pushed the fix/http-exporter-error-event branch from 87232d1 to 13b3bc4 Compare February 16, 2026 11:24
@pichlermarc pichlermarc marked this pull request as ready for review February 16, 2026 12:20
@pichlermarc pichlermarc force-pushed the fix/http-exporter-error-event branch from 9947056 to 37968e5 Compare February 16, 2026 22:40
Comment thread experimental/packages/otlp-exporter-base/src/transport/http-transport-utils.ts Outdated
Comment thread experimental/packages/otlp-exporter-base/src/transport/http-transport-utils.ts Outdated
res.socket?.destroy();
});
});
server.listen(8080);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Hardcoding a port could collide with something in use.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yep; I also noticed that when working on it. I must've done that when I initially wrote the tests - I've opted to leave this as-is for now to avoid blowing up the diff. I'll do another pass to address this after it's merged.

Comment thread experimental/CHANGELOG.md Outdated
@pichlermarc pichlermarc added this pull request to the merge queue Feb 24, 2026
Merged via the queue into open-telemetry:main with commit 99d6e15 Feb 24, 2026
27 checks passed
@pichlermarc pichlermarc deleted the fix/http-exporter-error-event branch February 24, 2026 16:10
@otelbot-js otelbot-js Bot mentioned this pull request Mar 3, 2026
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.

Missing res.on('error') handler in HTTP transport causes uncaughtException on ECONNRESET

3 participants