-
Notifications
You must be signed in to change notification settings - Fork 181
Add e2e test for metrics registration #651
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
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sanchezl The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test e2e-aws |
test/e2e/metrics_test.go
Outdated
| metrics[entry[0]] = entry[1] | ||
| } | ||
| require.NoError(t, scanner.Err()) | ||
| return metrics |
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.
make the test a bit easier to read with empty lines and high-level oneliner comments.
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.
Done.
test/e2e/metrics_test.go
Outdated
| transport, upgrader, err := spdy.RoundTripperFor(kubeConfig) | ||
| require.NoError(t, err) | ||
| request := restClient.Post().Resource("pods").Namespace(pod.Namespace).Name(pod.Name).SubResource("portforward") | ||
| dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, http.MethodPost, request.URL()) |
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.
why do we need a port forwarder? This sounds super complex.
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.
Not saying it is not necessary (maybe it is), but it surprises me as a reader and needs a comments explaining in 2 or 3 lines why.
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.
I've added some comments. AFAIK, port forwarding is needed in order for test to run outside of the cluster.
| @@ -0,0 +1,123 @@ | |||
| package e2e | |||
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.
should this go to library-go as an e2e helper and just a oneliner here?
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.
I intend to move to library-go once finalized.
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.
I've opened openshift/library-go#596 to start.
test/e2e/metrics_test.go
Outdated
| transport, upgrader, err := spdy.RoundTripperFor(kubeConfig) | ||
| require.NoError(t, err) | ||
| request := restClient.Post().Resource("pods").Namespace(pod.Namespace).Name(pod.Name).SubResource("portforward") | ||
| dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, http.MethodPost, request.URL()) |
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.
didn't we move to http/2 by now?
0209d57 to
dd400ae
Compare
dd400ae to
67b2d77
Compare
67b2d77 to
1b14899
Compare
|
Why is it valuable to check that pods are exposing metric endpoints in the absence of checking that prometheus is correctly configured to consume output from those endpoints (e.g. openshift/origin#24169)? It appears trivial to expose metric endpoints - any controller started by |
This test is specifically about the /metrics endpoint being there, but not returning ANY metrics. |
|
/test e2e-aws |
I thought that was the regression we had: we had an empty /metrics endpoint, but it was always served. cc @mfojtik |
|
@sanchezl: PR needs rebase. 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. |
|
@sanchezl I have a WIP test that trivially checks that prometheus can scrape the endpoint for a namespace. Once the related PRs merge I intend to add it as a helper to library-go that will enable a one-line check that can be called to check metrics collection for this operator: checkMetricsCollection(t, kubeConfig, operatorNamespace, [prometheus job name])Will that be sufficient to fix the but you're targeting, or will it be necessary to check the actual data that is being collected? |
|
@sanchezl: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
No description provided.