-
Notifications
You must be signed in to change notification settings - Fork 544
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
Emit CSV metric on startup #2216
Emit CSV metric on startup #2216
Conversation
Hi @josefkarasek. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@josefkarasek: This pull request references Bugzilla bug 1952576, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@openshift-ci[bot]: GitHub didn't allow me to request PR reviews from the following users: jianzhangbjz. Note that only operator-framework members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This is an alternative solution along with #2213 |
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.
/ok-to-test
2a70697
to
fc58998
Compare
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.
/lgtm
cf95b83
to
927d684
Compare
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.
/lgtm
/hold if we can make this change in the operator package it will be much easier to backport we can un-hold if there's a reason it needs to be in |
test/e2e/metrics_e2e_test.go
Outdated
@@ -116,6 +117,45 @@ var _ = Describe("Metrics are generated for OLM managed resources", func() { | |||
}) | |||
}) | |||
}) | |||
|
|||
When("the OLM pod restars", func() { |
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.
When("the OLM pod restars", func() { | |
When("the OLM pod restarts", func() { |
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.
The setup of the test feels a little unnatural to me. I would expect a When
block inside this Context
. And the layout ideally would something be:
Context("Metrics emitted by objects during operator installation", func() {
When("A CSV is created", func() {
BeforeEach(func() {
// create CSV
}
It("emits a CSV metrics", func() {
// check for CSV metrics
}
When("The OLM pod restarts", func() {
BeforeEach(func(){
// kill the deployment and wait for it to come up again
}
It("The csv metrics are preserved" func(){
// check for CSV metrics again
})
})
}
This leaves room for extending this portion of the test suite in the future
I don't see necessarily a "better" place for the EnsureCSVMetrics call since queueinformer.Operator.Run can't easily be wrapped, so this looks fine to me. If the spelling nit gets addressed, I'll re-lgtm this. /lgtm |
test/e2e/metrics_e2e_test.go
Outdated
@@ -116,6 +117,45 @@ var _ = Describe("Metrics are generated for OLM managed resources", func() { | |||
}) | |||
}) | |||
}) | |||
|
|||
When("the OLM pod restars", func() { |
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.
The setup of the test feels a little unnatural to me. I would expect a When
block inside this Context
. And the layout ideally would something be:
Context("Metrics emitted by objects during operator installation", func() {
When("A CSV is created", func() {
BeforeEach(func() {
// create CSV
}
It("emits a CSV metrics", func() {
// check for CSV metrics
}
When("The OLM pod restarts", func() {
BeforeEach(func(){
// kill the deployment and wait for it to come up again
}
It("The csv metrics are preserved" func(){
// check for CSV metrics again
})
})
}
This leaves room for extending this portion of the test suite in the future
776c9af
to
cb549b6
Compare
This looks good to me. If Evan's concerns have been assuaged (I don't see any conversation here that suggests that they have been yet), we can remove the hold and lgtm it. |
/retest |
1 similar comment
/retest |
Signed-off-by: Josef Karasek <jkarasek@redhat.com>
cb549b6
to
969ed27
Compare
/cc @anik120 |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dinhxuanvu, josefkarasek, kevinrizza The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Signed-off-by: Josef Karasek <jkarasek@redhat.com>
Signed-off-by: Josef Karasek <jkarasek@redhat.com>
* Update getMetricsFromPort to infer port number Problem: The getMetricsFromPod function assumes that metrics are exposed on port 8080. This function fails to retrieve metrics from the olm or catalog operator when the port is changed. Solution: Name the port in each of the deployments and update the getMetricsFromPod function to infer the port number from the deployments. Signed-off-by: Alexander Greene <greene.al1991@gmail.com> * Emit CSV metric on startup (#2216) Signed-off-by: Josef Karasek <jkarasek@redhat.com> * fix e2e CSV metric is preserved failure (#2530) Signed-off-by: akihikokuroda <akihikokuroda2020@gmail.com> Co-authored-by: Alexander Greene <greene.al1991@gmail.com> Co-authored-by: Josef Karasek <jkarasek@redhat.com> Co-authored-by: Akihiko (Aki) Kuroda <16141898+akihikokuroda@users.noreply.github.com>
csv_succeeded
metric is lost between pod restarts.This is because this metric is only emitted when CSV.Status is changed.
Description of the change:
Emit
csv_succeeded
/csv_abnormal
metric during OLM startupMotivation for the change:
csv_succeeded metric is lost between pod restarts.
Reviewer Checklist
/doc