-
Notifications
You must be signed in to change notification settings - Fork 26
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
add new object metric and fix e2e test #1035
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -33,7 +33,18 @@ rules: | |||||
pod: | ||||||
resource: pod | ||||||
metricsQuery: 'avg_over_time(vertica_process_memory_usage_percent[60m])' | ||||||
# # Number of active sessions. Type: guage | ||||||
# Total number of active sessions. Type: guage | ||||||
- metricsQuery: sum(vertica_sessions_running_counter{namespace!="", service!= "", type="active", initiator="user"}) by (namespace, service) | ||||||
name: | ||||||
as: ${1}_active_count | ||||||
matches: ^(.*)_running_counter$ | ||||||
resources: | ||||||
overrides: | ||||||
namespace: | ||||||
resource: namespace | ||||||
service: | ||||||
resource: service | ||||||
seriesQuery: vertica_sessions_running_counter{namespace!="", service!= "", type="active", initiator="user"} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are a lot of sessions which are initiated by the system. Those numbers are pretty large. We have to exclude those from calculating this metric. |
||||||
# - seriesQuery: 'vertica_sessions_running_counter{namespace!="", pod!=""}' | ||||||
# resources: | ||||||
# overrides: | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,8 @@ apiVersion: kuttl.dev/v1beta1 | |
kind: TestStep | ||
commands: | ||
- script: | | ||
NAMESPACE=$(kubectl get pod v-prometheus-pri1-0 -o=jsonpath='{.metadata.namespace}') | ||
echo "sleep 120 seconds before starting to verify metrics" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this sleep. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It took me a lot of time to debug the failure. The metric is not available right away after the adapter is installed. We have to wait some time. We need it. |
||
sleep 120 | ||
RESULT=$(kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/namespaces/$NAMESPACE/pods/v-prometheus-pri1-0/vertica_cpu_aggregate_usage_percentage) | ||
OUTPUT=$(echo $RESULT | jq -r '.items[0].value') | ||
# verify the metrics result | ||
|
@@ -24,23 +25,21 @@ commands: | |
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_process_memory_usage_percent) | ||
OUTPUT=$(echo $RESULT | jq -r '.items[0].value') | ||
# verify the metrics result | ||
if [[ "$OUTPUT" == "" ]]; then | ||
echo "empty custom metrics result on vertica_process_memory_usage_percent. 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_sessions_running_counter) | ||
# OUTPUT=$(echo $RESULT | jq -r '.items[0].value') | ||
# # verify the metrics result | ||
# if [[ "$OUTPUT" == "" ]]; then | ||
# echo "empty custom metrics result on vertica_sessions_running_counter. Result: $RESULT" | ||
# exit 1 | ||
# fi | ||
- script: | | ||
RESULT=$(kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/namespaces/$NAMESPACE/service/v-prometheus-pri1/vertica_sessions_active_count) | ||
OUTPUT=$(echo $RESULT | jq -r '.items[0].value') | ||
# verify the metrics result | ||
if [[ "$OUTPUT" == "" ]]; then | ||
echo "empty custom metrics result on vertica_sessions_active_count. 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) | ||
|
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.
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.
same comment as above.