-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for scheme in OTEL_EXPORTER_OTLP_ENDPOINT #1886
Conversation
|
Codecov Report
@@ Coverage Diff @@
## main #1886 +/- ##
=====================================
Coverage 79.4% 79.4%
=====================================
Files 139 139
Lines 7425 7449 +24
=====================================
+ Hits 5896 5918 +22
+ Misses 1285 1283 -2
- Partials 244 248 +4
|
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 suspect bugs in this PR.
@@ -71,13 +71,13 @@ func (e *EnvOptionsReader) GetOptionsFromEnv() []GenericOption { | |||
|
|||
// Endpoint | |||
if v, ok := e.getEnvValue("ENDPOINT"); ok { | |||
opts = append(opts, WithEndpoint(v)) | |||
opts = append(opts, endpointOptions(v, WithEndpoint, withInsecure)...) |
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.
Could this be simplified, and clarified by doing something like:
opts = append(opts,
WithEndpoint(trimSchema(v)),
withInsecure(strings.HasPrefix(v, "http://")),
)
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 changed it towards this direction, but with an explicit WithSecure
function which makes it a little bit more verbose
This updates the environment variable configuration to accept the OTLP Exporter Endpoint environment variables according to the spec. This includes the following changes:
http
-> insecure,https
-> secure)Resolves #1885