feat: test OTLP exporter TLS end to end#119
Open
krishankumar01 wants to merge 7 commits into
Open
Conversation
Add tls ca/cert/key knobs to the trace, metric, and log OTLP exporters, mirroring the framework stub, so the example can target a TLS-enabled collector (https:// endpoint with insecure=false).
There was a problem hiding this comment.
Pull request overview
This PR extends the example app’s telemetry configuration to allow OTLP trace/metric/log exporters to be configured for TLS by adding tls (ca/cert/key) file-path knobs in config/telemetry.go, aligning the example’s config surface with the framework’s expected options while keeping default plaintext behavior unchanged.
Changes:
- Add
tlsmap support to the OTLP trace exporter configuration (CA + optional mTLS client cert/key). - Add
tlsmap support to the OTLP metric exporter configuration (CA + optional mTLS client cert/key). - Add
tlsmap support to the OTLP log exporter configuration (CA + optional mTLS client cert/key).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…th framework master
Comment on lines
+40
to
+46
| func (s *TelemetryTLSTestSuite) SetupSuite() { | ||
| certsDir, err := filepath.Abs("../../tests/testdata/otel-tls") | ||
| s.Require().NoError(err) | ||
| s.certsDir = certsDir | ||
|
|
||
| caPath, err := generateCollectorCerts(certsDir) | ||
| s.Require().NoError(err) |
Comment on lines
+83
to
+91
| func (s *TelemetryTLSTestSuite) TearDownSuite() { | ||
| for key, value := range s.originalConfig { | ||
| facades.Config().Add(key, value) | ||
| } | ||
| s.NoError(facades.App().Restart()) | ||
|
|
||
| s.False(facades.Process().Path("../../").Run("docker compose --profile tls down").Failed()) | ||
| s.NoError(os.RemoveAll(s.certsDir)) | ||
| } |
Comment on lines
+48
to
+49
| s.False(facades.Process().Path("../../").Run("docker compose up -d prometheus jaeger loki otel-collector-tls").Failed()) | ||
| time.Sleep(5 * time.Second) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📑 Description
Tests the OTLP exporter TLS config from goravel/framework#1475 end to end.
otel-collector-tlscompose service: OTLP over TLS on:4319, exporting to the same Jaeger/Prometheus/Loki backends as the existing collector.TestTelemetryTLSTestSuitegenerates a CA and server certificate at setup, points the exporters athttps://localhost:4319/v1/<signal>withinsecure=falseandtls.ca, and asserts traces, metrics, and logs arrive.config/telemetry.gowithpackage:install Telemetryand pins the framework to current master, which also fixes theTestInstallAndUninstall*failures on master CI.✅ Checks