-
Notifications
You must be signed in to change notification settings - Fork 620
refactor(auto-instrumentations-node): migrate away from getEnv() #2708
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
refactor(auto-instrumentations-node): migrate away from getEnv() #2708
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2708 +/- ##
==========================================
- Coverage 92.45% 92.41% -0.05%
==========================================
Files 171 171
Lines 8140 8146 +6
Branches 1652 1654 +2
==========================================
+ Hits 7526 7528 +2
- Misses 614 618 +4
|
trentm
left a comment
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.
I'm a little more hesitant on this change, given that this package, sdk-node, and https://github.com/open-telemetry/opentelemetry-lambda/blob/faa6c56645b77d58f170f57ab016e845d815c0a8/nodejs/packages/layer/src/wrapper.ts#L470 would all need this change.
It might still be the easiest transition away from getEnv(), so I'm approving.
My original draft of the PR in core actually had a utility function to do this. I'll look into adding it back when I open the PR to update |
Which problem is this PR solving?
We're planning to remove
getEnv()as it does not scale well when everyone has to update@opentelemetry/coreto get their env vars. ForOTEL_*there will be a replacement utility function, but until this one is available, we can useprocess.envdirectly.Refs open-telemetry/opentelemetry-js#5443
Short description of the changes
Moves code for parsing
OTEL_LOG_LEVELto@opentelemetry/auto-instrumentations-nodehere. It may be changed later as we add similar code to@opentelemetry/sdk-node.