You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: OTel infrastructure — MeterProvider, exporters, attribute constants
Phase 1 of the OTel telemetry migration. Sets up the foundation with
no metric changes — validates the bridge works alongside controller-runtime.
MeterProvider setup (cmd/telemetry.go):
- Prometheus exporter registers into controller-runtime's metrics.Registry
so OTel instruments will appear on the existing /metrics endpoint
- OTLP exporter enabled when OTEL_EXPORTER_OTLP_ENDPOINT is set
- Resource attributes: service.name, service.version, k8s.pod.name,
k8s.namespace.name (via downward API env vars)
- Proper shutdown handling via defer
Attribute constants (observability/attributes.go):
- 9 per-datapoint attribute keys matching existing Prometheus label names
- No overloaded "type" — split into replica_state and condition_type
Build changes:
- Makefile and Dockerfile: go build ./cmd/ (package, not single file)
- OTel SDK dependencies added to go.mod
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use signal-cancellable context for MeterProvider init
Create the signal handler context once via ctrl.SetupSignalHandler()
and share it between the MeterProvider init and mgr.Start. The OTLP
exporter's gRPC connection setup respects cancellation on SIGTERM.
The shutdown defer intentionally uses context.Background() so the
OTLP exporter can flush its final batch after the signal fires.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add timeout to MeterProvider shutdown
Use a 5-second timeout on the shutdown context so the OTLP exporter
doesn't hang indefinitely if the collector is unreachable. The fresh
context.Background() is still correct (signal ctx is already cancelled
when defer runs), but now it's bounded.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments