Emit CSV metric on startup#2216
Emit CSV metric on startup#2216openshift-merge-robot merged 1 commit intooperator-framework:masterfrom
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. DetailsInstructions 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: DetailsIn 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. DetailsIn 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 |
2a70697 to
fc58998
Compare
cf95b83 to
927d684
Compare
|
/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 |
| }) | ||
| }) | ||
|
|
||
| When("the OLM pod restars", func() { |
There was a problem hiding this comment.
| When("the OLM pod restars", func() { | |
| When("the OLM pod restarts", func() { |
There was a problem hiding this comment.
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 |
| }) | ||
| }) | ||
|
|
||
| When("the OLM pod restars", func() { |
There was a problem hiding this comment.
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 |
|
[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 DetailsNeeds 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_succeededmetric 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_abnormalmetric during OLM startupMotivation for the change:
csv_succeeded metric is lost between pod restarts.
Reviewer Checklist
/doc