feat: add Prometheus metrics for operator reconciliation#780
feat: add Prometheus metrics for operator reconciliation#780Chaithanya5gif wants to merge 2 commits into
Conversation
The `make test` target was missing, causing developers to run tests without exporting KUBEBUILDER_ASSETS. This led to envtest control plane startup failures with 'etcd not found in PATH' errors. Changes: - Added new `test` target that depends on `envtest` and automatically exports KUBEBUILDER_ASSETS via setup-envtest -p path - Fixed `coverage` target to use `envtest` dependency and export KUBEBUILDER_ASSETS - Refactored `test-env` to depend on `envtest` for clarity - Updated CONTRIBUTING.md with 'Running Tests Locally' documentation Fixes meshery#777 Signed-off-by: chaithanya <chaithanyyal55@gmail.com>
Add Prometheus metrics to Meshery Operator for observability: - meshery_operator_reconcile_total (counter) - meshery_operator_reconcile_errors_total (counter) - meshery_operator_reconcile_duration_seconds (histogram) Changes: - New pkg/metrics package with metric definitions - Instrument BrokerReconciler with timing and error tracking - Instrument MeshSyncReconciler with timing and error tracking - Tests for metric registration Fixes meshery#779 Signed-off-by: chaithanya <chaithanyyal55@gmail.com>
|
Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, you can find updates in the #github-notifications channel in the community Slack. |
|
Thanks for this, the reconcile counters and duration histogram are exactly the kind of observability we want on the operator. We are keeping this and folding it into Workstream 5 (metrics and TLS hardening), which adds authn/authz-protected metrics serving on the modernized controllers. Heads up that Workstreams 2 and 3 are reworking We will keep this open and iterate rather than supersede it. |
|
Things are looking pretty good here, @Chaithanya5gif. 👍 A few merge conflicts have popped up, but outside of those I think we're about ready to merge. We need some documentation in Meshery Docs on the fact that the Operator is now emitting these metrics for monitoring. Please add to the Production Deployment docs and hyperlink your issue and PR on the docs here, please. |
|
Thanks again, @Chaithanya5gif. I reviewed the changes in detail and pulled the reconciliation instrumentation forward onto the current A few notes from the review:
This keeps us moving toward folding the work into Workstream 5 (metrics + TLS hardening). Once WS-2/WS-3 reshape the reconciler signatures, we'll rebase once more on top of those. Appreciate you kicking this off. 🙏 |
|
Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a MeshMate or any other community member for assistance.
|
|
@leecalcote Thanks for the detailed review and for pulling this forward in #793. I see the merge conflicts since you've already integrated the metrics work into #793, should I close this PR and focus on the documentation follow up you requested? I'll work on adding the Operator metrics monitoring guide to the Production Deployment docs and open a separate docs PR. |
Description
This PR fixes #779
Add Prometheus metrics to Meshery Operator for observability:
meshery_operator_reconcile_total— total reconciliations by controllermeshery_operator_reconcile_errors_total— total errors by controllermeshery_operator_reconcile_duration_seconds— reconciliation duration by controllerChanges:
pkg/metricspackage with metric definitionsBrokerReconcilerwith timing and error trackingMeshSyncReconcilerwith timing and error trackingNotes for Reviewers:
metrics.Registry.MustRegisterfor automatic expositionSigned commits