Repository navigation
orchestratord: add reconciliation metrics and Kubernetes events - #39426
Merged
Alphadelta14 merged 1 commit intoOct 1, 2026
Merged
Alphadelta14 merged 1 commit into
Alphadelta14 merged 1 commit into
Conversation
Adopt k8s-controller 0.13.0, which provides reconciliation metrics and events, and use it in place of orchestratord's own wrapper: - report every controller's passes and named steps to k8s-controller's Prometheus metrics, under the orchestratord prefix - give each controller its own event recorder, so a failed pass is published as a ReconcileFailed warning event whose reporting controller names the controller that failed - publish each UpToDate transition of a Materialize as an event - grant the operator create and patch on events.k8s.io events - teach mz-metrics-catalog to document metrics constructed with PrometheusMetrics::new, which it could not see as metric! invocations Part of CLO-188. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alex-hunt-materialize
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Part of CLO-188. This reimplements #39030 on top of k8s-controller 0.13.0, which now provides reconciliation metrics and Kubernetes events itself (MaterializeInc/k8s-controller#52). The metric names, steps and lifecycle events are the same; orchestratord no longer carries its own reconciliation wrapper and event publisher.
Description
k8s-controllerto 0.13.0 with itsprometheusfeature.orchestratordprefix and reports every controller's passes to them:orchestratord_reconciliations_total{controller, phase, outcome}orchestratord_reconciliation_duration_seconds{controller, phase}orchestratord_reconciliation_steps_total{controller, step, outcome}orchestratord_reconciliation_step_duration_seconds{controller, step}TraceMetadataeach pass receives, with the same step names as CLO-188 Add events and more metrics to orchestratord (attempt 3) #39030.EventRecorder, so the event's reporting controller identifies it:orchestratord.materialize.cloud/materialize,/balanceror/console, with the pod name as the instance. A failed pass publishes aReconcileFailedwarning event on the resource, with the error and its causes as the note.UpToDatetransition as an event once the status is written. The condition's reason and message become the event's. It's a warning when the environment is not up to date, except while waiting for approval.createandpatchonevents.k8s.ioevents.mz-metrics-catalogonly sawmetric!invocations, so it now also recognizesPrometheusMetrics::new("<namespace>"). It documents those metrics by constructing them and reading back their descriptions, as it already does for tokio's runtime metrics. It now depends onk8s-controllerandk8s-openapi, which makes the catalog lint slower to build.Differences from #39030 that reviewers may notice:
ReconcileFailed, notReconciliationFailed.phaserather thanevent_type.orchestratord.materialize.cloud.Verification
mz-metrics-catalog: a test thatPrometheusMetricsconstructions are documented with the right names and labels.mz-orchestratord: a test of which lifecycle transitions are published as warnings.test/orchestratord:failure-eventsworkflow, with a nightly step. It drives an environment through two different failures, a missing backend secret and then an invalid license key, and checks that theReconcileFailedevent's note follows the current cause.manually-promotenow checks that each rollout phase was published as an event.post_run_checkwithexpect_fail) now also check for aReconcileFailedevent.Release notes
This release will publish Kubernetes events on Materialize, Balancer and Console resources when the operator fails to reconcile them, and on each Materialize rollout phase, so
kubectl describeshows why a resource isn't progressing. The operator's ClusterRole now includescreateandpatchonevents.k8s.ioevents.🤖 Generated with Claude Code