Remove metrics logic from cmd/anisble-operator/main.go#3466
Remove metrics logic from cmd/anisble-operator/main.go#3466bharathi-tenneti merged 3 commits intooperator-framework:masterfrom
Conversation
joelanford
left a comment
There was a problem hiding this comment.
We can also remove these lines, I think:
operator-sdk/internal/scaffold/role.go
Lines 329 to 356 in 6a36023
| # header_text "verify that the metrics endpoint exists (Port 8686)" | ||
| # if ! timeout 1m bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sfo /dev/null http://memcached-operator-metrics:8686/metrics; do sleep 1; done"; | ||
| # then | ||
| # error_text "FAIL: Failed to verify that metrics endpoint exists" | ||
| # operator_logs | ||
| # exit 1 | ||
| # fi |
There was a problem hiding this comment.
This can be fully removed since port 8686 is only for the legacy kube-state-metrics stuff that's being removed.
| # exit 1 | ||
| # fi | ||
|
|
||
| # header_text "verify that the metrics endpoint exists (Port 8383)" |
There was a problem hiding this comment.
Add a TODO here to add a --metrics-addr flag to the ansible operator and default it to 8080.
See #3440
Once we have an equivalent PR merged for ansible, we'll need to update this port to be 8080.
| exit 1 | ||
| fi | ||
| # header_text "verify that metrics reflect cr creation" | ||
| # if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8686/metrics | grep example-memcached; do sleep 1; done"; |
There was a problem hiding this comment.
Since the metric is now on 8383 via the instrumented handler:
| # if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8686/metrics | grep example-memcached; do sleep 1; done"; | |
| # if ! timeout 60s bash -c -- "until kubectl run --attach --rm --restart=Never test-metrics --image=$metrics_test_image -- curl -sf http://memcached-operator-metrics:8383/metrics | grep example-memcached; do sleep 1; done"; |
e1f9e1b to
92181b0
Compare
|
New changes are detected. LGTM label has been removed. |
fabianvf
left a comment
There was a problem hiding this comment.
LGTM, though it needs a rebase
| breaking: true | ||
| migration: | ||
| header: Remove legacy metrics generation code from cmd/ansible-operator/main.go, and tests/e2e-anisble.sh checks for servicemonitor. | ||
| body: TBD No newline at end of file |
92181b0 to
dd55394
Compare
dd55394 to
d69ae93
Compare
Description: Remove kubemetrics package reference logic from cmd/ansible-operator/main.go.
Remove corresponding checks from hack/tests/e2e-ansible.sh
Motivation: Now that we have handler to setup metrics on primary resources using handler.InstrumentedEnqueueRequestForObject{}, we do not separate KubeMetrics to setup metrics.