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

fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used #4649

Merged

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Apr 19, 2024

Which problem is this PR solving?

When running in a Browser and a process polyfill is used, getEnv() and getEnvWithoutDefaults() behave in different ways. getEnvWithoutDefaults() will use the polyfilled process.env and getEnv() will use _globalThis. This aligns the behavior of both.

The inconsistent behavior can lead to results where span-limits are configured differently based on if a polyfill is used or not. I'm not sure if anyone is actually using environment configuration via _globalThis, though. It feels to me like using this would be a weird choice for configuring things.

Enables #4648, where we have to use a process polyfill to update to karma-webpack@5.0.1

Type of change

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

How Has This Been Tested?

  • Unit tests

@pichlermarc pichlermarc marked this pull request as ready for review April 19, 2024 11:31
@pichlermarc pichlermarc requested a review from a team April 19, 2024 11:31
@pichlermarc pichlermarc added the bug Something isn't working label Apr 23, 2024
CHANGELOG.md Outdated Show resolved Hide resolved
@pichlermarc pichlermarc merged commit 141b457 into open-telemetry:main Apr 26, 2024
18 checks passed
pichlermarc added a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request May 6, 2024
…efaults() when a process polyfill is used (open-telemetry#4649)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used

* Update CHANGELOG.md
pichlermarc added a commit that referenced this pull request May 15, 2024
…ents (#4705)

* fix(resources): prevent circular import (resource -> detector -> resource -> ...) (#4653)

* fix(resources): prevent circular import (resource -> detector -> resource -> ...)

* fixup! fix(resources): prevent circular import (resource -> detector -> resource -> ...)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used (#4649)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used

* Update CHANGELOG.md

* fix(deps): update dependency import-in-the-middle to v1.7.4 (#4667)

* fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base depen… (#4678)

* fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* chore: sync package-lock.json, adapt changelog

* chore: prepare release 1.24.1/0.51.1

* chore: adjust changelog

* chore: sync package-lock.json

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Aksel Allas <allasaksel@gmail.com>
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
…efaults() when a process polyfill is used (open-telemetry#4649)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used

* Update CHANGELOG.md
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
…ents (open-telemetry#4705)

* fix(resources): prevent circular import (resource -> detector -> resource -> ...) (open-telemetry#4653)

* fix(resources): prevent circular import (resource -> detector -> resource -> ...)

* fixup! fix(resources): prevent circular import (resource -> detector -> resource -> ...)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used (open-telemetry#4649)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used

* Update CHANGELOG.md

* fix(deps): update dependency import-in-the-middle to v1.7.4 (open-telemetry#4667)

* fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base depen… (open-telemetry#4678)

* fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* chore: sync package-lock.json, adapt changelog

* chore: prepare release 1.24.1/0.51.1

* chore: adjust changelog

* chore: sync package-lock.json

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Aksel Allas <allasaksel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants