-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Log when Environment Provider tries to pull unset or empty env var #9837
Conversation
a40aed4
to
555b34d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9837 +/- ##
==========================================
+ Coverage 91.13% 91.32% +0.19%
==========================================
Files 353 357 +4
Lines 18735 19179 +444
==========================================
+ Hits 17074 17516 +442
- Misses 1333 1335 +2
Partials 328 328 ☔ View full report in Codecov by Sentry. |
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.
LGTM after rewording the function name and moving to an appropriate place. We may undergo a bit of churn on the confmap
code still, so I think it's okay to leave NewNopProviderSettings
there until we figure out how the code structure will look like
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.
Looks good to me, thanks for adding this.
Description:
Creates a logger in the confmap.ProviderSettings and uses it to log when there is a missing or blank environment variable referenced in config. For now the noop logger is used everywhere except tests.
Link to tracking Issue: 5615
Testing:
I wrote unit tests that ensured
I also started the otel collector with the sample config - and added an env var reference in the sample config. I then inserted a print statement next to each log call to see whether my code paths were hit in the live application. I then went through the 3 cases mentioned above and ensured that logging behavior was accurate.