-
Notifications
You must be signed in to change notification settings - Fork 440
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
[EXPORTER] Boolean environment variables not parsed per the spec #1982
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[EXPORTER] Boolean environment variables not parsed per the spec
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1982 +/- ##
==========================================
+ Coverage 87.11% 87.29% +0.18%
==========================================
Files 166 166
Lines 4597 4662 +65
==========================================
+ Hits 4004 4069 +65
Misses 593 593
|
5 tasks
Ready for review. |
owent
approved these changes
Feb 15, 2023
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 and thanks.
lalitb
approved these changes
Feb 16, 2023
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. Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1859 [EXPORTER] Boolean environment variables not parsed per the spec
Changes in SDK
Moved the implementation of GetEnvironmentVariable() from .h
to GetRawEnvironmentVariable() in .cc
Changed the prototype to return bool exists,
to decouple environment variables existence from empty value.
Implemented typed helpers to properly parse values:
Changes in Exporters environment variables
Moved GetXXXDefaultYYY() helpers from otlp_environment.h to .cc
Renamed all helpers for orthogonality:
This exposed many bugs and inconsistencies, for example for Endpoint()
Before:
After:
This renaming is a potential breaking change for logs (now in plural form),
which is acceptable because logs are not fully implemented yet.
This renaming is a potential breaking change if a user application
used existing helpers for traces and metrics,
so original names are also provided for backward compatibility.
For example:
Added all the helpers required to parse environment variables
defined in the spec, for example for traces SSL/TLS options:
In otlp_environment.cc, implemented typed helpers
for environment variables that can have dual names:
Refactored all the GetXXXDefaultYYY() implementation to use
these helpers.
For special cases like GetOtlpDefaultTracesIsInsecure(),
provided a migration path from old variables (OTEL_EXPORTER_OTLP_TRACES_SSL_ENABLE)
to new variables (OTEL_EXPORTER_OTLP_TRACES_INSECURE)
Prepared the code for future variables deprecation,
with #define WARN_DEPRECATED_ENV.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes