diff --git a/prometheus/adapter.yaml b/prometheus/adapter.yaml index 16af75916..8c73c2419 100644 --- a/prometheus/adapter.yaml +++ b/prometheus/adapter.yaml @@ -42,12 +42,12 @@ rules: # pod: # resource: pod # metricsQuery: 'sum(increase(vertica_sessions_running_counter[1m])) by (namespace, pod)' - # # Number of requests that are queued in the resource pool. Type: guage - # - seriesQuery: 'vertica_queued_requests_total{namespace!="", pod!=""}' - # resources: - # overrides: - # namespace: - # resource: namespace - # pod: - # resource: pod - # metricsQuery: 'sum(increase(vertica_queued_requests_total[1m])) by (namespace, pod)' + # Number of requests that are queued in the resource pool. Type: guage + - seriesQuery: 'vertica_queued_requests_total{namespace!="", pod!=""}' + resources: + overrides: + namespace: + resource: namespace + pod: + resource: pod + metricsQuery: 'sum(vertica_queued_requests_total) by (namespace, pod)' diff --git a/tests/e2e-leg-12/prometheus-sanity/35-verify-custom-metrics.yaml b/tests/e2e-leg-12/prometheus-sanity/35-verify-custom-metrics.yaml index f2ddd0648..232ba21e6 100644 --- a/tests/e2e-leg-12/prometheus-sanity/35-verify-custom-metrics.yaml +++ b/tests/e2e-leg-12/prometheus-sanity/35-verify-custom-metrics.yaml @@ -41,12 +41,12 @@ commands: # echo "empty custom metrics result on vertica_sessions_running_counter. Result: $RESULT" # exit 1 # fi - # - script: | - # NAMESPACE=$(kubectl get pod v-prometheus-pri1-0 -o=jsonpath='{.metadata.namespace}') - # RESULT=$(kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/namespaces/$NAMESPACE/pods/v-prometheus-pri1-0/vertica_queued_requests_total) - # OUTPUT=$(echo $RESULT | jq -r '.items[0].value') - # # verify the metrics result - # if [[ "$OUTPUT" == "" ]]; then - # echo "empty custom metrics result on vertica_queued_requests_total. Result: $RESULT" - # exit 1 - # fi + - script: | + NAMESPACE=$(kubectl get pod v-prometheus-pri1-0 -o=jsonpath='{.metadata.namespace}') + RESULT=$(kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/namespaces/$NAMESPACE/pods/v-prometheus-pri1-0/vertica_queued_requests_total) + OUTPUT=$(echo $RESULT | jq -r '.items[0].value') + # verify the metrics result + if [[ "$OUTPUT" == "" ]]; then + echo "empty custom metrics result on vertica_queued_requests_total. Result: $RESULT" + exit 1 + fi