-
Notifications
You must be signed in to change notification settings - Fork 846
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(sdk-trace-base)!: do not read environment variables from window #5455
feat(sdk-trace-base)!: do not read environment variables from window #5455
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5455 +/- ##
==========================================
+ Coverage 94.94% 94.97% +0.02%
==========================================
Files 309 309
Lines 8016 8016
Branches 1699 1704 +5
==========================================
+ Hits 7611 7613 +2
+ Misses 405 403 -2
|
f80a79e
to
245c6f8
Compare
}); | ||
default: | ||
diag.error( | ||
`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".` | ||
`OTEL_TRACES_SAMPLER value "${sampler} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".` | ||
); | ||
return new AlwaysOnSampler(); |
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.
Unrelated to this PR: it strikes me as wrong that ParentBasedAlwaysOn
is the default if not specified, but a different value (AlwaysOnSampler
) is the fallback if the given value is unknown.
I opened #5476 for this.
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.
that is indeed wrong - thank you for opening the issue.
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" (via
window.OTEL_*
) in browser environments. As such I had to move some tests to different places to ensure they only run in the correct context.This breaking change now will enable us to split the env var config code completely in a non-breaking feature release later.
Refs #5217
Type of change
How Has This Been Tested?