Repository navigation
Conversation
The series labeled by profile and by ClusterSummary are only ever set or incremented, so they outlive the objects they describe. After a delete, matching_clusters keeps the last count of the profile, and reconcile_consecutive_failures and reconcile_last_success_timestamp_seconds keep the last value of the ClusterSummary until the addon-controller restarts. When a cluster is deleted the undeploy is skipped, so a failing feature keeps reporting its failures. Remove the matching_clusters series of a ClusterProfile/Profile once its finalizer is removed, and the series of a ClusterSummary in postFinalizerCleanup, after the undeploy recorded its last outcome. reconcile_duration_seconds and reconcile_operations_total are shared by all the ClusterSummaries of a cluster and are left alone.
Author
|
@gianlucam76 could you review this when you have a moment? It does for ClusterProfiles, Profiles and ClusterSummaries what |
Member
|
Thank you @Kitio-Tek Will review it tomorrow morning. thank you again for pushing this! |
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.
Fixes #2029
The series labeled by profile and by ClusterSummary are only ever set or incremented, so they outlive the objects they describe. After a ClusterProfile is deleted,
projectsveltos_matching_clusterskeeps its last count. A deleted ClusterSummary keeps itsreconcile_consecutive_failuresandreconcile_last_success_timestamp_seconds, and when its cluster is gone the undeploy is skipped, so a feature that was failing keeps reporting failures that never clear.This adds
clearMatchingClustersandclearClusterSummaryMetricstometrics.go:clearMatchingClustersoncereconcileDeleteCommonsucceeded, next tocleanMaps. It is the counterpart of thetrackMatchingClusterscall inreconcileNormal.postFinalizerCleanupcallsclearClusterSummaryMetrics, so it runs once the finalizer is removed. The undeploy records a lastRemovedoutcome before that, and a ClusterSummary whose deletion is blocked (cluster paused or not ready) keeps its series.clearClusterSummaryMetricsgets the profile labels fromgetProfileLabels, like the recording side, and callsDeletePartialMatchwithout the feature and status labels, so every feature and both outcomes go. The match includes the cluster labels, which keeps the series of the same profile on other clusters and of other profiles on the same cluster.DeletePartialMatchwalks every series of the metric, but only on a delete.I left
reconcile_duration_secondsandreconcile_operations_totalalone. They are not labeled by profile and are shared by all the ClusterSummaries of a cluster, so they would have to go with the cluster, and an undeploy still running when the cluster goes could record them again. @gianlucam76 do you want them removed too, in a follow-up? I also didn't touch the shard handover: when a ClusterSummary moves to another shard, the old shard's addon-controller keeps its series.outdated_helm_chartis left to its checker, which has its own gap: #2030.Tests, next to the existing
reconcileDeletespecs:matching_clustersseries of a ClusterProfile, and of a Profile, is gone once the finalizer is removed, while the series of the other kind with the same name, and of a Profile with the same name in another namespace, stay.The three removal specs fail on main and pass here.
make testandmake lintpass. On kind,make fvandmake new-fvpass, and so doesmake fv-agentlesson a fresh cluster. With the reproduction steps from the issue,/metricshas no series left for the deleted profiles and ClusterSummaries. Onlyreconcile_duration_secondsandreconcile_operations_totalof the deleted SveltosCluster remain, as said above.Nothing changes while the objects exist: same metrics, labels and values.