Conversation
There was a problem hiding this comment.
Pull request overview
Adds documentation to highlight the ReconcileContext.Metrics dependency used for condition-metrics recording during component reconciliation.
Changes:
- Documented the
Metricsfield indocs/component.mdand noted the metrics recorder implementation source. - Updated the README Quick Start
ReconcileContextsnippet to includeMetrics: r.Metrics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/component.md | Adds a note explaining that a Metrics recorder is required and links to the recommended implementation. |
| README.md | Updates the Quick Start reconcile snippet to pass a Metrics recorder into ReconcileContext. |
| The `Metrics` field is required. The framework records Prometheus metrics for every condition state transition during | ||
| reconciliation. The recorder implementation is provided by | ||
| [go-crd-condition-metrics](https://github.com/sourcehawk/go-crd-condition-metrics). |
There was a problem hiding this comment.
The text says metrics are recorded for every condition state transition, but the current implementation calls the Metrics recorder every time setStatusCondition runs (even when the condition didn’t change). Consider rewording to reflect that the recorder is invoked on each reconciliation/condition set, with transitions reflected via LastTransitionTime rather than being the only time RecordConditionFor is called.
| The `Metrics` field is required. The framework records Prometheus metrics for every condition state transition during | |
| reconciliation. The recorder implementation is provided by | |
| [go-crd-condition-metrics](https://github.com/sourcehawk/go-crd-condition-metrics). | |
| The `Metrics` field is required. The framework invokes the Prometheus metrics recorder whenever it updates a component | |
| condition during reconciliation; condition state transitions are reflected via each condition's `LastTransitionTime`. | |
| The recorder implementation is provided by [go-crd-condition-metrics](https://github.com/sourcehawk/go-crd-condition-metrics). |
| Client: r.Client, | ||
| Scheme: r.Scheme, | ||
| Recorder: r.Recorder, | ||
| Metrics: r.Metrics, | ||
| Owner: owner, |
There was a problem hiding this comment.
The Quick Start snippet now references r.Metrics, but README doesn’t explain what this is or how to construct a component.Recorder (e.g., via go-crd-condition-metrics) or what a minimal/no-op implementation looks like for users who don’t want metrics. Adding a short note/link near this snippet would prevent copy/paste confusion.
No description provided.