-
Notifications
You must be signed in to change notification settings - Fork 929
fix(otlp-exporter-base)!: split node and browser config types in two #5917
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(otlp-exporter-base)!: split node and browser config types in two #5917
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5917 +/- ##
=======================================
Coverage 95.06% 95.07%
=======================================
Files 307 308 +1
Lines 8031 8039 +8
Branches 1627 1627
=======================================
+ Hits 7635 7643 +8
Misses 396 396
🚀 New features to boost your workflow:
|
...ental/packages/otlp-exporter-base/test/browser/configuration/otlp-http-configuration.test.ts
Show resolved
Hide resolved
@maryliag thank you for taking a look. 🙂 Since you mentioned it here: I've been working on the follow-up test (#4744 like) in the background today - I just pushed them to this PR. You should be able to see them failing over at this draft #5919. The test itself is very simple (it only runs webpack and checks if the thing builds or not), but should help us catch regressions like this in the future. 🙂 |
I had planned the extra tests to be a follow-up but it turned out to be simpler than I thought. :) |
awesome! thank you for adding the test! 🚀 |
Which problem is this PR solving?
See #5908, browser exporters are broken due to dynamic import of
node:http
in the defaults. What is happening is thatgetHttpConfigurationDefaults()
is called, which uses thehttpAgentFactoryFromOptions()
function to create an agent factory, which does not work in the browser.This PR fixes this, by introducing a new type
OtlpNodeHttpConfiguration
along with node-specific merge and default functions, that are based on the ones forOtlpHttpConfiguration
. This is a breaking change as the name of the type changes, however it gives us more flexibility in the future to have these configurations diverge further without breaking one another.Related PR: #5719
Fixes #5908
Related #4744
Type of change
How Has This Been Tested?
examples/opentelemetry-web
main