-
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 gauge metrics for number of existing backups and restores #1353
Add gauge metrics for number of existing backups and restores #1353
Conversation
So far so good. I'm thinking maybe we call these metrics |
I like Reading https://prometheus.io/docs/practices/naming/, I wonder if |
Based on that sounds like we should use |
Good catch. I'm on board with |
I didn't like the names I picked either. I thought about the _count suffix but found it would be more appropriate for counters. |
For updating these, I think a a go routine for updating the counters or in the resync functions (as proposed here) would be ideal. This way, they're kept up-to-date without having to worry about changing all locations that a backup/restore could be created or deleted. That's particularly true for restores, since they can be deleted directly from the client side. |
Sorry but I still can't tell which option is better/cleaner (haven't studied go routines yet). c.resyncFunc = c.resync
c.resyncPeriod = syncPeriod And then create the func (c *backupController) resync() {
backups, err := c.lister.List(labels.Everything())
c.metrics.SetBackupTotal(len(backups));
} And finally do the same for |
6c2bde3
to
6a95ad8
Compare
Signed-off-by: fabito <fuechi@ciandt.com>
6a95ad8
to
475cf2a
Compare
@fabito I think this looks reasonable as-is -- it's nice and simple, no need to manage our own goroutines for metrics updates. |
@fabito if you're interested in continuing to contribute to velero, I'm happy to help find new issues and provide some direction! We've really appreciated your contributions so far. Let me know. |
Sure @skriss , point me to another issue and I'll do my best. |
Closes #1077
Signed-off-by: fabito fuechi@ciandt.com