-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add velero_backup_active_total metric #5703
base: main
Are you sure you want to change the base?
Conversation
As is pointed out in this comment: The active backup should always be 0 or 1, I'm not sure if we need a gauge here. |
@reasonerjt I think this is a useful change:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
f2958fc
to
b2c86c4
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is not stale |
Thanks, I am working on getting this rebased. I think it might make more sense with all the async work that's been done, I will try it and see. |
b2c86c4
to
5985553
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5703 +/- ##
==========================================
+ Coverage 58.99% 59.01% +0.01%
==========================================
Files 367 367
Lines 38847 38864 +17
==========================================
+ Hits 22918 22935 +17
Misses 14467 14467
Partials 1462 1462 ☔ View full report in Codecov by Sentry. |
Now that we have an async phase of Backup after InProgress, this value will not just be 0 or 1 -- if one backup is InProgress and two are WaitingForPluginOperations, then we'll see a value of 3. |
The change looks good, but we still need to make this PR rebase to merge. |
5985553
to
053f449
Compare
@Lyndon-Li Please also take a look. |
I finally remembered to watch this while running some backups, and it does go above 1 now:
|
@mrnold Would you mind rebase to squash the commits? |
Per doc, you should be able to Squash and merge too right? One could perhaps set this as default merge method. |
053f449
to
fd6f375
Compare
Okay, this is rebased and squashed into one commit now. |
@@ -121,6 +121,7 @@ func (r *backupFinalizerReconciler) Reconcile(ctx context.Context, req ctrl.Requ | |||
velerov1api.BackupPhaseFailed, | |||
velerov1api.BackupPhaseFailedValidation: | |||
r.backupTracker.Delete(backup.Namespace, backup.Name) | |||
r.metrics.DecrementActiveBackupTotal() |
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.
Wouldn't we be decrementing twice? If not, please add a comment which decrement is the common happy path case and which is fallback/failure etc.
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.
Yes, I think I was trying to match every decrement with every Delete, but I guess this one only runs if the backup didn't get deleted for some reason? That would cause extra decrements, so I will take this one out.
@kaovilai I'd think "squash and merge" would be better than the merge commit option. Merge commits make the history messy. |
This counts the number of backups currently in progress. Signed-off-by: Matthew Arnold <[email protected]> Better metrics function names. Signed-off-by: Matthew Arnold <[email protected]> Update copyright notice as per contribution guidelines. Signed-off-by: Matthew Arnold <[email protected]> Add changelog file. Signed-off-by: Matthew Arnold <[email protected]> Rework backup_active_total after rebase. Signed-off-by: Matthew Arnold <[email protected]> Remove extraneous decrement. Signed-off-by: Matthew Arnold <[email protected]>
6a98066
fd6f375
to
6a98066
Compare
|
/assign @mpryc |
Signed-off-by: Matthew Arnold [email protected]
Please add a summary of your change
Add a backup_active_total metric, as requested in #2254. This metric counts the number of backups in progress.
Does your change fix a particular issue?
Fixes #2254
Please indicate you've done the following:
/kind changelog-not-required
as a comment on this pull request.site/content/docs/main
.