feat: test OTLP exporter TLS end to end - #119
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
hwbrzzl
left a comment
There was a problem hiding this comment.
LGTM, please consider the Copilot comments.
|
Could you add some examples based on https://github.com/goravel/docs/pull/192/changes#diff-2869e2731d8a93f0fb13dc4cd219545d1b4cdf8d12c79d8ea7012690f2b3d6ff? It's good to show how to use the telemetry module. It's fine to add them in another PR or this one. |
Will raise a separate PR for this |
📑 Description
Tests the OTLP exporter TLS config from goravel/framework#1475 end to end.
otel-collector-tlscompose service: OTLP over TLS on:4319(behind thetlscompose profile), 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.tests/telemetrykit shared by both telemetry suites: compose lifecycle with readiness probes instead of sleeps, polling backend assertions (AwaitTraces/AwaitMetric/AwaitLogs), config override/restore scope, and teardown owned byTestMain. Each suite claims a uniquetelemetry.service.name. Conventions documented in AGENTS.md.Manual telemetry usage examples (custom spans, metrics, propagation, per the v1.18 docs) will follow in a separate PR as a consumer of this kit.
✅ Checks