-
Notifications
You must be signed in to change notification settings - Fork 1.2k
otlploggrpc: set config.gRPCCredentials.Value properly when using TLS/mTLS certificates #7087
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?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7087 +/- ##
=====================================
Coverage 82.9% 82.9%
=====================================
Files 262 262
Lines 24460 24463 +3
=====================================
+ Hits 20281 20287 +6
+ Misses 3801 3799 -2
+ Partials 378 377 -1
🚀 New features to boost your workflow:
|
|
Hi Team, It seems it's not possible to test the grpc dial options from below link.
|
|
The codecov check is not a blocker. |
config.gRPCCredentials.Value properly when using TLS/mTLS certificatesconfig.gRPCCredentials.Value properly when using TLS/mTLS certificates
config.gRPCCredentials.Value properly when using TLS/mTLS certificates|
@xue20xi, are you able to address the follow comment (from #7087 (comment)):
? |
Hi @pellared , I have not find a way to do the test, it seems the result returned by I have tried to write something like below, but the |
|
How about creating unit tests for @XSAM, any other proposal? |
Another approach could be using an End-to-End test to actually test against a TLS gRPC server. The test pseudo code could be something like this func TestClientWithTLSCertificate(t *testing.T) {
// Create a test TLS server
cert, key := generateTestCertificate()
tlsConfig := &tls.Config{Certificates: []tls.Certificate{cert}}
// Start gRPC server with TLS
creds := credentials.NewTLS(tlsConfig)
srv := grpc.NewServer(grpc.Creds(creds))
// Set environment variable
t.Setenv("OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE", certPEM)
// Create client and verify it can connect
client, err := New(context.Background())
require.NoError(t, err)
// Export logs and verify success
err = client.Export(context.Background(), testLogs)
assert.NoError(t, err)
} |
|
@xue20xi, bump 😉 |
Fix #6661