Repository navigation
Description
Problem
When the OpenTelemetry collector endpoint uses TLS with a certificate signed by a private/internal CA, there is no way to inject a custom CA certificate into the proxyrunner pod for the OTLP exporter to trust it.
The CRD has CA bundle support for OIDC (spec.oidcConfig.*.caBundleRef), but the telemetry configuration (MCPTelemetryConfig and inline OpenTelemetryConfig) has no equivalent TLS/CA fields. The OTLP exporters in pkg/telemetry/providers/otlp/ only configure Endpoint and Insecure — they don't use WithTLSClientConfig().
Current workaround
Users can use podTemplateSpec to mount a ConfigMap containing the CA cert and set SSL_CERT_FILE via resourceOverrides.proxyDeployment.env. However, SSL_CERT_FILE replaces the entire system CA pool, so the user must concatenate the custom CA with the container's existing system CAs into a single bundle. This is fragile and error-prone.
Proposed solution
Add a caBundleRef field to MCPTelemetryOTelConfig (and optionally the inline OpenTelemetryConfig), reusing the existing CABundleSource type from OIDC. Then:
- CRD types: Add
CABundleRef *CABundleSourcetoMCPTelemetryOTelConfigincmd/thv-operator/api/v1alpha1/mcptelemetryconfig_types.goand toOpenTelemetryConfiginmcpserver_types.go. - Volume mounting: In
deploymentForMCPServer(), mount the ConfigMap as a volume following the same pattern asAddOIDCCABundleVolumes()incmd/thv-operator/pkg/controllerutil/oidc_volumes.go. - Config threading: Pass the CA bundle file path through
telemetry.Config→otlp.Config→ exporter options. - Exporter TLS: Use
otlptracehttp.WithTLSClientConfig()andotlpmetrichttp.WithTLSClientConfig()inpkg/telemetry/providers/otlp/tracing.goandmetrics.go.
The building blocks are all there from the OIDC CA bundle implementation — this is primarily wiring the same pattern into the telemetry config path.
Key files
- CRD types:
cmd/thv-operator/api/v1alpha1/mcptelemetryconfig_types.go,mcpserver_types.go - OTLP exporters:
pkg/telemetry/providers/otlp/tracing.go,metrics.go,config.go - Telemetry config:
pkg/telemetry/config.go - Deployment assembly:
cmd/thv-operator/controllers/mcpserver_controller.go - Existing pattern to follow:
cmd/thv-operator/pkg/controllerutil/oidc_volumes.go - Spec-to-config conversion:
cmd/thv-operator/pkg/spectoconfig/telemetry.go
Activity
Add TLS support for OTLP endpoints and OTel CA bundle volume helper
Add TLS support for OTLP endpoints and OTel CA bundle volume helper
ChrisJBurns commentedon Apr 8, 2026
I'm picking this up, it's worth noting, we won't do the MCPServer type for OTEL because its deprecated and will be removed by the time we go to
v1beta1Add custom CA certificate support for OTLP endpoints in MCPTelemetryC…
Add custom CA certificate support for OTLP endpoints in MCPTelemetryC…