-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ansible: add custom resource metrics #1723
ansible: add custom resource metrics #1723
Conversation
/retest |
3 similar comments
/retest |
/retest |
/retest |
/test e2e-aws-ansible |
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 overall, thanks!
fi | ||
|
||
# verify that the metrics endpoint exists | ||
if ! timeout 1m bash -c -- "until kubectl run -it --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi7/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8383/metrics; do sleep 1; done"; |
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 believe you asked on slack how to test custom resource metrics.
So this is for the controller-runtime metrics, you could add the same test for the custom resource metrics, so seeing if the metrics exists on 8686 port.
Another thing you could do is, we know exactly what the metrics data will be so you could curl the endpoint and compare the result to a predefined string. If you look at the go e2e test you can see how the metrics data would look like here
operator-sdk/test/e2e/_incluster-test-code/memcached_test.go
Lines 392 to 395 in d6e1aba
Metric: | |
# HELP memcached_info Information about the Memcached operator replica. | |
# TYPE memcached_info gauge | |
memcached_info{namespace="memcached-memcached-group-cluster-1553683239",memcached="example-memcached"} 1 |
Hope that makes sense, otherwise feel free to ask any questions!
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.
Note that the verification needs to happen after line 79, so after creating CR instance. As that is when the metric should be 1.
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 think we wanted to add the same check for the other metrics port so port 8686.
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 believe I was able to manage it the check for port 8686 and for the CR info. Not having much experience with these metrics I just used grep. Let me know what you think. Thank you for the help.
LGTM once Travis is passing, will take a deeper dive to see why it's failing |
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
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.
Otherwise lgtm, thanks for this!
fi | ||
|
||
# verify that the metrics endpoint exists | ||
if ! timeout 1m bash -c -- "until kubectl run -it --rm --restart=Never test-metrics --image=registry.access.redhat.com/ubi7/ubi-minimal:latest -- curl -sfo /dev/null http://memcached-operator-metrics:8383/metrics; do sleep 1; done"; |
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 think we wanted to add the same check for the other metrics port so port 8686.
Hi David, just wanted to touch back to see if you have an idea for when you can get the last couple of nits so we can close/merge this? |
Perfect timing 😎. I've been struggling to get back to this but I have this afternoon to work on it. If you've seen no changes by Tuesday then I've messed up. |
9034fac
to
4ab0ba0
Compare
Figuring out the check and then this will be ready. |
4ab0ba0
to
f1775d3
Compare
This PR enables custom resource metrics for ansible based operators.
f1775d3
to
c07cea7
Compare
/retest |
2 similar comments
/retest |
/retest |
/test e2e-aws-ansible |
In the Ansible Operator tests, we should verify that the metrics reflect that an instance of the memcached resource has been created. Also add the change to the Changelog.
c07cea7
to
5e2315c
Compare
@joelanford @theishshah I believe this is ready to go. Thank you for your patience. |
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 thanks!
Description of the change:
This PR enables custom resource metrics for ansible based operators.
Motivation for the change:
Closes #1554