-
Notifications
You must be signed in to change notification settings - Fork 651
otelconf: add tests for grpc exporters with different certificate configurations #7233
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
base: main
Are you sure you want to change the base?
otelconf: add tests for grpc exporters with different certificate configurations #7233
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7233 +/- ##
=======================================
+ Coverage 81.0% 81.1% +0.1%
=======================================
Files 204 204
Lines 18080 18148 +68
=======================================
+ Hits 14651 14729 +78
+ Misses 3003 3000 -3
+ Partials 426 419 -7 🚀 New features to boost your workflow:
|
@pellared this should be ready for review now - I'm not sure if a changelog entry is needed as this PR only adds tests. |
From build failure
Guessing that |
…nto otelconf-grpc-exporter-test # Conflicts: # otelconf/go.mod
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.
otelconf/v0.3.0/log_test.go
Outdated
n, err := net.Listen("tcp", "localhost:0") | ||
require.NoError(t, err) | ||
|
||
tt.args.otlpConfig.Endpoint = ptr(strings.ReplaceAll(n.Addr().String(), "127.0.0.1", "localhost")) |
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.
Isn't this a workaround?
Shouldn't this work?
n, err := net.Listen("tcp", "127.0.0.1:0")
require.NoError(t, err)
tt.args.otlpConfig.Endpoint = ptr(n.Addr().String())
--- FAIL: Test_otlpGRPCLogExporter/with_TLS_config_and_client_key (0.00s)
/home/hello-there/repos/opentelemetry-go-contrib/otelconf/v0.3.0/log_test.go:814:
Error Trace: /home/hello-there/repos/opentelemetry-go-contrib/otelconf/v0.3.0/log_test.go:814
Error: Received unexpected error:
parse "127.0.0.1:44735": invalid URI for request
Test: Test_otlpGRPCLogExporter/with_TLS_config_and_client_key
Shouldn't we create a bug that the confiugration is not working e.g. for 127.0.0.1:4318
?
The option SHOULD accept any form allowed by the underlying gRPC client implementation.
CC @codeboten
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.
yes, I added a comment for now indicating that this is a workaround - forgot to include that when I first stumbled over this
This PR adds component tests for the otlp grpc exporters for logs/metrics/traces. The tests work by starting a simple grpc server that implements the
Export
interface of the respective signals, and records what is being sent to it. This should server as a way to verify that the otlp exporters created within this package are able to communicate with the server.Closes #7222