-
Notifications
You must be signed in to change notification settings - Fork 0
add note about metric recorder #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -260,6 +260,7 @@ recCtx := component.ReconcileContext{ | |||||||||||||
| Client: r.Client, // sigs.k8s.io/controller-runtime/pkg/client | ||||||||||||||
| Scheme: r.Scheme, // *runtime.Scheme | ||||||||||||||
| Recorder: r.Recorder, // record.EventRecorder | ||||||||||||||
| Metrics: r.Metrics, // component.Recorder (condition metrics) | ||||||||||||||
| Owner: owner, // the CRD that owns this component | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -268,6 +269,10 @@ err = comp.Reconcile(ctx, recCtx) | |||||||||||||
|
|
||||||||||||||
| Dependencies are passed explicitly so components remain testable and decoupled from global state. | ||||||||||||||
|
|
||||||||||||||
| 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). | ||||||||||||||
|
Comment on lines
+272
to
+274
|
||||||||||||||
| 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Quick Start snippet now references
r.Metrics, but README doesn’t explain what this is or how to construct acomponent.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.