feat: rework metrics#1872
Merged
Merged
Conversation
Replace the per-cluster metric-name histograms (cluster identity baked into the Prometheus metric name via Namespace, producing one never-unregistered metric per cluster) and the two unlabeled global histograms with a single properly labeled reconcile_duration_seconds histogram. Add outcome and fleet-adoption visibility that didn't exist before, and ship the RBAC that was missing for anyone actually trying to scrape /metrics. Metrics (all `projectsveltos_` prefixed): - **reconcile_duration_seconds** (histogram): cluster_type, cluster_namespace, cluster_name, feature. Buckets extended to 600s to catch slow Helm installs that used to fall into +Inf with no visibility. - **reconcile_operations_total** (counter): cluster_type, cluster_namespace, cluster_name, feature. Counts every reconcile attempt. - **reconcile_outcome_total** (counter): cluster_type, cluster_namespace, cluster_name, feature, status, profile_kind, profile_namespace, profile_name. Terminal success/failure only, answers "is add-on X failing on N clusters." - **matching_clusters** (gauge): profile_kind, profile_namespace, profile_name. Clusters currently matching a ClusterProfile/Profile selector. - **reconcile_consecutive_failures** (gauge): cluster_type, cluster_namespace, cluster_name, feature, profile_kind, profile_namespace, profile_name. Mirrors ClusterSummary.status.featureSummaries[].consecutiveFailures. - **reconcile_last_success_timestamp_seconds** (gauge): same labels as above. Unix timestamp of last Provisioned/Removed outcome. - **total_drifts** (counter): cluster_type, cluster_namespace, cluster_name, feature, profile_kind, profile_namespace, profile_name. Existing metric, gained the profile_* labels. Also: - Fix metric name prefix: - Enable auth-proxy RBAC resources (metrics-reader ClusterRole, Service, proxy-role/binding) in config/rbac/kustomization.yaml. Previously /metrics was protected by kube-rbac-proxy with no way to grant a scraper access without hand-authoring the RBAC yourself.
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.
Replace the per-cluster metric-name histograms (cluster identity baked into the Prometheus metric name via Namespace, producing one never-unregistered metric per cluster) and the two unlabeled global histograms with a single properly labeled reconcile_duration_seconds histogram. Add outcome and fleet-adoption visibility that didn't exist before, and ship the RBAC that was missing for anyone actually trying to scrape /metrics.
Metrics (all
projectsveltos_prefixed):Also: