-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow http/https scheme in otlpexporter endpoint configuration #3575
Allow http/https scheme in otlpexporter endpoint configuration #3575
Conversation
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.
@alanwest thanks for working on this. Let's merge after open-telemetry/opentelemetry-specification#1729 is merged.
exporter/otlpexporter/README.md
Outdated
[here](https://github.com/grpc/grpc/blob/master/doc/naming.md) | ||
[here](https://github.com/grpc/grpc/blob/master/doc/naming.md). | ||
Including a scheme of `http` or `https` is allowed in the `endpoint`, but not required. | ||
If a scheme of `https` is used then client transport security overriding the `insecure` setting. |
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.
Can you please clarify this sentence? I am not sure I understand it.
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.
Oops, yes I've left out some words, so this sentence makes no sense! Fixed.
The idea is that if you use the scheme https
then the insecure
setting is ignored. This is inline with the outstanding spec PR open-telemetry/opentelemetry-specification#1729
@tigrannajaryan I've added a test validating the exporter when the endpoint has an I noted that the The code that sets up the mock receiver is here opentelemetry-collector/exporter/otlpexporter/otlp_test.go Lines 75 to 79 in d1fced9
I essentially need to do something like the following to run the test using TLS: sopts := []grpc.ServerOption{}
creds, _ := credentials.NewServerTLSFromFile(grpctestdata.Path("testdata/test_cert.pem"), grpctestdata.Path("testdata/test_cert_key.pem"))
sopts = append(sopts, grpc.Creds(creds))
rcv := &mockTracesReceiver{
mockReceiver: mockReceiver{
srv: grpc.NewServer(sopts...),
},
} |
Yes, I think it is ok. |
Please rebase |
Fixed merge conflicts and added a test using the scheme https. I had to create a new certificate in order to generate the private key. I replaced the existing cert in the testdata directory since it did not seem that it was used anywhere. Is this all good? |
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. Thank you @alanwest
Description: otlpexporter endpoint configuration allows for an
http
orhttps
scheme. The scheme is stripped off when instantiating the gRPC channel. A scheme ofhttps
indicates a secure channel. This aligns the collector with this hopefully soon-to-be-merged specification PR open-telemetry/opentelemetry-specification#1729Link to tracking Issue: #2539
Documentation: Updated readme