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

feat(sdk-logs)!: do not read environment variables from window #5472

Conversation

pichlermarc
Copy link
Member

Which problem is this PR solving?

Migrates from getEnv() to using the new get*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

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • Unit tests

@pichlermarc pichlermarc added the target:next-major-release This PR targets the next major release (`next` branch) label Feb 13, 2025
@pichlermarc pichlermarc added this to the OpenTelemetry SDK 2.0 milestone Feb 13, 2025
@pichlermarc pichlermarc requested a review from a team as a code owner February 13, 2025 17:20
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.91%. Comparing base (3c65b56) to head (f8d5eca).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5472   +/-   ##
=======================================
  Coverage   94.91%   94.91%           
=======================================
  Files         308      308           
  Lines        7981     7992   +11     
  Branches     1682     1693   +11     
=======================================
+ Hits         7575     7586   +11     
  Misses        406      406           
Files with missing lines Coverage Δ
experimental/packages/sdk-logs/src/config.ts 100.00% <100.00%> (ø)
...sdk-logs/src/export/BatchLogRecordProcessorBase.ts 93.61% <100.00%> (+0.67%) ⬆️

Copy link
Contributor

@trentm trentm left a comment

Choose a reason for hiding this comment

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

I'll trust you on the Karma/browser-test changes. I haven't learned what Karma is doing.

@pichlermarc pichlermarc added this pull request to the merge queue Feb 17, 2025
Merged via the queue into open-telemetry:main with commit 5c90aec Feb 17, 2025
18 checks passed
@pichlermarc pichlermarc deleted the feat/migrate-from-getenv-sdk-logs branch February 17, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target:next-major-release This PR targets the next major release (`next` branch)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants