Skip to content
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

Expose etcdbr_snapshot_required metric #193

Merged

Conversation

shreyas-s-rao
Copy link
Collaborator

Signed-off-by: Shreyas Rao [email protected]

What this PR does / why we need it:
This PR exposes new metric etcdbr_snapshot_required that exposes a Gauge metric to indicate whether a snapshot is required to be taken, based on whether a new etcd revision is observed.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
Also contains minor linting corrections.

Release note:

Expose new metric `etcdbr_snapshot_required`.

@shreyas-s-rao shreyas-s-rao added kind/enhancement Enhancement, improvement, extension reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) area/monitoring Monitoring (including availability monitoring and alerting) related needs/review Needs review component/etcd-backup-restore ETCD Backup & Restore platform/all needs/lgtm Needs approval for merging labels Aug 30, 2019
@shreyas-s-rao shreyas-s-rao added this to the 0.8.0 milestone Aug 30, 2019
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 30, 2019
Copy link
Contributor

@swapnilgm swapnilgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shreyas-s-rao
Copy link
Collaborator Author

@swapnilgm That check is only to see if a delta snapshot is required, so it doesn't check whether a full snapshot is required there (atleast at the moment). And again, this code path is taken only when we decide to start with delta snapshot, but not for the case where we start with full snapshot.

@shreyas-s-rao shreyas-s-rao force-pushed the expose-snapshot-required-metric branch from fe51e75 to 8eb44cb Compare August 30, 2019 09:17
@shreyas-s-rao
Copy link
Collaborator Author

@swapnilgm Thanks for your comments. I've updated the PR. PTAL.

@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Aug 30, 2019
@PadmaB
Copy link

PadmaB commented Aug 30, 2019

How about post restoration, if triggered? Shouldn't the metric be reset appropriately?

@shreyas-s-rao shreyas-s-rao force-pushed the expose-snapshot-required-metric branch from 8eb44cb to 0dc6124 Compare August 30, 2019 09:45
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 30, 2019
@shreyas-s-rao
Copy link
Collaborator Author

@PadmaB Once restoration is complete, the snapshotter will start again, and we set the appropriate metric values there. So there's no need to explicitly reset the metrics after restoration.

@shreyas-s-rao shreyas-s-rao added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 30, 2019
Copy link
Contributor

@swapnilgm swapnilgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Couple of more minor changes.

pkg/snapshot/snapshotter/snapshotter.go Show resolved Hide resolved
pkg/snapshot/snapshotter/snapshotter.go Show resolved Hide resolved
@shreyas-s-rao shreyas-s-rao force-pushed the expose-snapshot-required-metric branch from 0dc6124 to c94dece Compare August 31, 2019 17:30
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Aug 31, 2019
@shreyas-s-rao
Copy link
Collaborator Author

@swapnilgm Thanks for your review. I've addressed your comments. PTAL.

Copy link
Contributor

@swapnilgm swapnilgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for quick resolve. I have suggested some more changes please address those.

Copy link
Contributor

@swapnilgm swapnilgm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for answers

@swapnilgm swapnilgm merged commit ad163f7 into gardener:master Sep 3, 2019
@shreyas-s-rao shreyas-s-rao deleted the expose-snapshot-required-metric branch September 3, 2019 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/monitoring Monitoring (including availability monitoring and alerting) related component/etcd-backup-restore ETCD Backup & Restore kind/enhancement Enhancement, improvement, extension needs/lgtm Needs approval for merging needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review platform/all
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants