Skip to content
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

Conversation

remychantenay
Copy link
Contributor

Fixes #4147

@@ -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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewer(s) – This test is a dupe, see L151 below.

@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Merging #4155 (97b04ac) into main (b907996) will decrease coverage by 0.1%.
The diff coverage is 80.6%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #4155     +/-   ##
=======================================
- Coverage   83.3%   83.3%   -0.1%     
=======================================
  Files        181     181             
  Lines      13928   13955     +27     
=======================================
+ Hits       11615   11634     +19     
- Misses      2092    2098      +6     
- Partials     221     223      +2     
Impacted Files Coverage Δ
...ters/otlp/otlptrace/internal/otlpconfig/options.go 81.1% <80.0%> (-0.5%) ⬇️
...xporters/otlp/otlpmetric/internal/oconf/options.go 79.7% <81.2%> (-0.2%) ⬇️

... and 1 file with indirect coverage changes

@remychantenay remychantenay force-pushed the fix-otlp-exporters-default-endpoints branch from f3418d6 to 8045992 Compare May 31, 2023 15:09
CHANGELOG.md Outdated Show resolved Hide resolved
@@ -89,16 +89,23 @@ func NewHTTPConfig(opts ...HTTPOption) Config {
URLPath: DefaultMetricsPath,
Compression: NoCompression,
Timeout: DefaultTimeout,
Insecure: true,
Copy link
Contributor

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?

Copy link
Member

@pellared pellared May 31, 2023

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.

This option only applies to OTLP/gRPC when an endpoint is provided without the http or https scheme.

insecure is by default true 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 the Insecure field if the HTTP scheme is defined. (I guess this is what @MrAlias has in mind)

Copy link
Contributor Author

@remychantenay remychantenay Jun 1, 2023

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.

Copy link
Contributor

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 says

This option only applies to OTLP/gRPC when an endpoint is provided without the http or https scheme - OTLP/HTTP always uses the scheme provided for the endpoint.

My 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 though Insecure= true, but if the scheme in the HTTP endpoint is https, it should act as ifInsecure=false. The wording seems to indicate that the user setting for Insecure shouldn't be changed, but rather the exporter should just use the appropriate setting regardless of the Insecure 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 to Insecure=false.

pellared

This comment was marked as outdated.

@pellared
Copy link
Member

This is related to #4016

CHANGELOG.md Outdated Show resolved Hide resolved
@MrAlias MrAlias added the pkg:exporter:otlp Related to the OTLP exporter package label Sep 14, 2023
@pellared
Copy link
Member

I do not think it is possible to fix the issue without making a breaking change or creating new API.
See #4147 (comment)

What do you think?

I plan to close this PR by the end of the week if I do not get any feedback.

@remychantenay
Copy link
Contributor Author

I do not think it is possible to fix the issue without making a breaking change or creating new API. See #4147 (comment)

What do you think?

I plan to close this PR by the end of the week if I do not get any feedback.

Hey @pellared,

My sincere apologies for the radio silence. I was abroad, got caught up in other stuff, and never really came back to this. I don't want to be a burden more than I already have been. Also, I will be offline from tomorrow until the end of the month, and considering the time that has gone by since I opened this PR, I think it's best to close this PR.

Happy to do so.

Again, my sincere apologies for the inconvenience to all of you.

@pellared
Copy link
Member

@remychantenay There is nothing you need to be sorry about. I would rather blame myself for even rising the issue 🙈 Thank your for contribution 👍

@pellared pellared closed this Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:exporter:otlp Related to the OTLP exporter package
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

OTLP exporters have improper default endpoint
6 participants