Skip to content

feat(otel-collector): render OTel Collector from LogCollector.spec.otelCollector#4979

Draft
tianfeng92 wants to merge 1 commit into
tigera:masterfrom
tianfeng92:PMREQ-822-otel-collector
Draft

feat(otel-collector): render OTel Collector from LogCollector.spec.otelCollector#4979
tianfeng92 wants to merge 1 commit into
tigera:masterfrom
tianfeng92:PMREQ-822-otel-collector

Conversation

@tianfeng92

Copy link
Copy Markdown
Contributor

Summary

  • Adds OpenTelemetryCollector CRD with support for logs (OTLP receiver) and metrics (Prometheus receiver) pipelines
  • Implements controller with license gating, mTLS certificate management, and deployment override validation
  • Renders StatefulSet with dynamically generated OTel Collector config (receivers, processors, exporters, pipelines) based on CR spec
  • Extends LogCollector types to carry OTel-related fields for fluent-bit integration
  • Uses combined calico mono-image (CombinedCalicoImage) consistent with upstream refactor

Changes

Area Files
CRD types api/v1/otelcollector_types.go, api/v1/logcollector_types.go, zz_generated.deepcopy.go
Controller pkg/controller/otelcollector/controller.go, internal/controller/
Render pkg/render/otelcollector/component.go
Validation pkg/common/validation/otelcollector/validation.go
LogCollector integration pkg/controller/logcollector/logcollector_controller.go
Tests pkg/render/otelcollector/component_test.go, pkg/controller/otelcollector/otelcollector_controller_test.go
Generated CRDs pkg/imports/crds/operator/

Test plan

  • Render tests pass (22 cases): make ut UT_DIR=./pkg/render/otelcollector
  • Controller tests pass (6 cases): make ut UT_DIR=./pkg/controller/otelcollector
  • Pre-commit hooks (goimports, formatting) pass
  • Full CI (make ci)
  • Deploy to test cluster and verify collector receives logs/metrics

🤖 Generated with Claude Code

@tianfeng92
tianfeng92 requested review from a team and marvin-tigera as code owners June 29, 2026 19:52
@marvin-tigera marvin-tigera added this to the v1.44.0 milestone Jun 29, 2026
@tianfeng92
tianfeng92 marked this pull request as draft June 29, 2026 19:52
@tianfeng92
tianfeng92 force-pushed the PMREQ-822-otel-collector branch from 69eaaa5 to 48c6ba9 Compare June 30, 2026 23:37
Comment thread pkg/render/otelcollector/component.go Fixed
@tianfeng92 tianfeng92 closed this Jul 1, 2026
@tianfeng92 tianfeng92 reopened this Jul 1, 2026
@tianfeng92
tianfeng92 force-pushed the PMREQ-822-otel-collector branch from 5585581 to f084ce5 Compare July 8, 2026 21:50
@tianfeng92
tianfeng92 force-pushed the PMREQ-822-otel-collector branch 2 times, most recently from d677acf to 210d27f Compare July 17, 2026 20:23
@tianfeng92 tianfeng92 changed the title feat(otel-collector): add OpenTelemetryCollector CRD, controller, and render feat(otel-collector): render OTel Collector from LogCollector.spec.otelCollector Jul 17, 2026
Action: v3.Allow,
Protocol: &networkpolicy.TCPProtocol,
Destination: v3.EntityRule{
Ports: networkpolicy.Ports(uint16(p)),
@tianfeng92
tianfeng92 force-pushed the PMREQ-822-otel-collector branch 3 times, most recently from ea3c7e6 to 0eb2e6b Compare July 17, 2026 22:05
…elCollector

Add an opt-in OTel Collector managed by a new log-collector-otel
controller, configured via a new otelCollector section on the
LogCollector CR:

- StatefulSet (calico-system, controlPlaneReplicas, mono-image otelcol)
  with health probes, self-monitoring metrics on 8888, and CR overrides
- OTLP/HTTP receiver with mTLS (Tigera CA + operator-issued keypair)
  fed by a fluent-bit opentelemetry output rendered when the section
  is set
- transform processor classifies log records (audit/dns/flows) into
  service.name via body-field probes
- optional metrics pipeline federates from tigera-prometheus through
  its authn-proxy (ServiceAccount token + services/proxy RBAC),
  inheriting everything the existing ServiceMonitors scrape
- customer exporters (otlp/otlphttp) fan out from the CR; the rendered
  NetworkPolicy derives per-exporter egress ports from endpoint URLs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tianfeng92
tianfeng92 force-pushed the PMREQ-822-otel-collector branch from 0eb2e6b to 722ff23 Compare July 17, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants