-
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
Fix otlp exporters default endpoints #4155
Closed
remychantenay
wants to merge
5
commits into
open-telemetry:main
from
remychantenay:fix-otlp-exporters-default-endpoints
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a4a81a2
Fix default endpoints for otlptrace package
remychantenay 8045992
Fix default endpoints for otlpmetric package
remychantenay 9f10b14
Update CHANGELOG.md
remychantenay ab5d4ff
Update CHANGELOG.md
pellared 97b04ac
Merge branch 'main' into fix-otlp-exporters-default-endpoints
hanyuancheung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,10 +137,9 @@ func TestConfig(t *testing.T) { | |
assert.Len(t, rCh, 0, "failed HTTP responses did not occur") | ||
}) | ||
|
||
t.Run("WithURLPath", func(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
path := "/prefix/v2/metrics" | ||
ePt := fmt.Sprintf("http://localhost:0%s", path) | ||
exp, coll := factoryFunc(ePt, nil, WithURLPath(path)) | ||
t.Run("WithInsecure", func(t *testing.T) { | ||
ePt := "http://localhost:0" | ||
exp, coll := factoryFunc(ePt, nil, WithInsecure()) | ||
ctx := context.Background() | ||
t.Cleanup(func() { require.NoError(t, coll.Shutdown(ctx)) }) | ||
t.Cleanup(func() { require.NoError(t, exp.Shutdown(ctx)) }) | ||
|
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
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
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
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
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.
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.
The default for this should be false according to the specification: https://github.com/open-telemetry/opentelemetry-specification/blob/v1.21.0/specification/protocol/exporter.md#configuration-options
Why is this set to
true
here?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 just want to add a not that the specification is not worded perfectly.
insecure
is by defaulttrue
when an endpoint is provided without the http or https scheme.Still, I think that we should keep the
false
as default and not interpret theInsecure
field if the HTTP scheme is defined. (I guess this is what @MrAlias has in mind)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.
Thank you both. Looks like there is a bit of confusion from my end. I will re-read the specs with rested eyes over the weekend.
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.
@remychantenay
The wording for
insecure
saysMy interpretation of this is that OTLP/HTTP endpoints must include a scheme (as noted n the specification). But the scheme overrides whatever setting there may be for
Insecure
in the config (i.e. it's a noop setting for OTLP/HTTP).For example, if the OTLP/HTTP endpoint starts with
http
, then the exporter should act as thoughInsecure= true
, but if the scheme in the HTTP endpoint ishttps
, it should act as ifInsecure=false
. The wording seems to indicate that the user setting forInsecure
shouldn't be changed, but rather the exporter should just use the appropriate setting regardless of theInsecure
value in the config.For OTLP/gRPC, there are more options for specifying the endpoint. But if the gRPC endpoint includes an http or https scheme, then the same "ignore what the setting says and act as though it is whatever the scheme says" applies the same as in OTLP/HTTP.
But if the gRPC endpoint does not include an http or https scheme, then the
Insecure
setting should be taken into account and should default toInsecure=false
.