feat(connectivity): provision OpenTelemetry monitoring on the delegated resource - #500
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ed resource Resolve the stack's OpenTelemetry configuration with settings.GetOpenTelemetryConfiguration (collector-aware: points at otel-collector.<stack>:4318 when the per-stack collector exists, else honours the opentelemetry.* Settings) and embed it inline in the delegated Connectivity's spec.monitoring, mirroring the Ledger v3 Cluster pattern. The connectivity operator turns spec.monitoring into OTEL_* env vars on the workload; there is no separate Monitoring object to reference. The whole spec.monitoring block is rebuilt on every reconcile and pruned when telemetry is disabled, so the reconcile stays idempotent. Not-tested: end-to-end env-var emission by the connectivity operator (covered by the connectivity repo); unit tests assert the inline spec mapping and idempotency.
✅ Approve — automated reviewThe OpenTelemetry monitoring wiring for the delegated Connectivity resource looks correct. The previously identified major issue — the No findings. |
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #500 (comment)
1b46489 to
937367d
Compare
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot posted 1 new inline finding.
Summary: #500 (comment)
…d monitoring GetOpenTelemetryConfiguration injects pod-name=$(POD_NAME), which only resolves when a downward-API POD_NAME env var is defined ahead of OTEL_RESOURCE_ATTRIBUTES. The connectivity operator emits OTEL_RESOURCE_ATTRIBUTES verbatim from spec.monitoring.attributes and defines no such env var, so the placeholder surfaced literally in the delegated workload's telemetry. Strip attributes whose value carries an unresolvable $(...) placeholder before forwarding, keeping literal resource attributes (stack, custom). Omit the attributes field entirely when nothing resolvable remains.
NumaryBot
left a comment
There was a problem hiding this comment.
NumaryBot review complete: no remaining inline findings.
Resolved 1 stale NumaryBot review thread (0 fixed, 1 outdated).
Summary: #500 (comment)
Summary
Wire OpenTelemetry observability into the Connectivity module, mirroring the Ledger v3 pattern.
settings.GetOpenTelemetryConfiguration(ctx, stack.Name, "connectivity"). This is collector-aware: it points the signals atotel-collector.<stack>:4318when the per-stack collector Service exists, otherwise it honours theopentelemetry.*Settings.spec.monitoring(same shape as Ledger v3'sCluster.spec.monitoring). The connectivity operator'sMonitoringConfigis a struct embedded in the CRD spec — there is no separateMonitoringobject to create or reference. The connectivity operator turnsspec.monitoringintoOTEL_*env vars on the workload.otlpexporter; traces are batched, metrics carry runtime instrumentation — matching the Ledger v3 mapping.Idempotency
The whole
spec.monitoringblock is rebuilt inside the existingCreateOrUpdatemutate closure on every reconcile, and pruned (RemoveNestedField) when telemetry is disabled — so repeated reconciles converge to the same object.Test plan
go test ./internal/resources/connectivities/...greenapplyConnectivityMonitoring,connectivityMonitoringSpec)just pre-commit(tidy, lint, generate, manifests, helm, docs, settings-catalog)Notes
feat/connectivity-module— this stacks the observability wiring on top of the connectivity module work.OTEL_*env-var emission is owned by the connectivity operator repo and covered there.