Allow adding collectors to OpinionatedWatcher and OpinionatedReconciler#1272
Draft
IfSentient wants to merge 1 commit intomainfrom
Draft
Allow adding collectors to OpinionatedWatcher and OpinionatedReconciler#1272IfSentient wants to merge 1 commit intomainfrom
IfSentient wants to merge 1 commit intomainfrom
Conversation
…nd OpinionatedReconciler Addresses issue #1271 by allowing direct registration of Prometheus collectors on both OpinionatedWatcher and OpinionatedReconciler without implementing the full ResourceWatcher/Reconciler interface. Follows the same pattern as simple.App.RegisterMetricsCollectors. Changes: - Add collectors field to both types - Add RegisterMetricsCollectors() method - Add PrometheusCollectors() method to OpinionatedReconciler - Update Wrap() to extract collectors from wrapped types - Add comprehensive tests for the new functionality Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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.
What Changed? Why?
Addresses Issue #1271
Both
OpinionatedWatcherandOpinionatedReconcilernow support direct registration of Prometheus collectors without requiring users to implement the fullResourceWatcher/Reconcilerinterface. This adds aRegisterMetricsCollectors()method to both types, following the established pattern insimple.App.RegisterMetricsCollectors.How was it tested?
All new functionality is covered by comprehensive tests:
Wrap()functionalityAll existing tests continue to pass.
Where did you document your changes?
Documentation is in code comments for the new public methods.
Notes to Reviewers
This is a minimal, non-breaking change that adds optional functionality. The
collectorsfield is internal to both types, and the new methods follow existing patterns in the codebase.Authored by claude code