-
Notifications
You must be signed in to change notification settings - Fork 847
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(resources)!: do not read environment variables from window #5466
feat(resources)!: do not read environment variables from window #5466
Conversation
8255f87
to
b0cbbe0
Compare
1ff2e02
to
b100bd6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5466 +/- ##
==========================================
- Coverage 94.90% 94.90% -0.01%
==========================================
Files 308 308
Lines 7975 7974 -1
Branches 1677 1677
==========================================
- Hits 7569 7568 -1
Misses 406 406
|
54e1a1c
to
b100bd6
Compare
}); | ||
}); | ||
|
||
describe('with invalid env', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the new method is no longer possible to have invalid values?
or doesn't matter because it returns the empty and you're already testing that below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the browser tests that before this PR allowed for users to set window.OTEL_SERVICE_NAME
. Now on the browser this will always return an empty resource, as the new functions always return undefined
in the browser.
That means that the EnvDetector
is now a no-op detector for Browsers, hence no need to test many inputs anymore. 🙂
Which problem is this PR solving?
Migrates from
getEnv()
to using the newget*FromEnv()
methods added in #5443. Also inlines the defaults. This drops "env var configuration" (viawindow.OTEL_*
) in browser environments.This breaking change will basically make the
EnvDetector
a no-op detector for browser environments.Refs #5217
Type of change
How Has This Been Tested?