Skip to content
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 metric vertica_queued_requests_total #1036

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/samples/v1beta1_verticaautoscaler_custom_metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,15 @@ spec:
target:
type: Value
value: "6"
- metric:
type: Object
object:
describedObject:
apiVersion: v1
kind: Service
name: verticadb-sample-sc1
metric:
name: vertica_queued_requests_count
target:
type: Value
value: "3"
29 changes: 12 additions & 17 deletions prometheus/adapter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,15 @@ rules:
service:
resource: service
seriesQuery: vertica_sessions_running_counter{namespace!="", service!= "", type="active", initiator="user"}
# - seriesQuery: 'vertica_sessions_running_counter{namespace!="", pod!=""}'
# resources:
# overrides:
# namespace:
# resource: namespace
# 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!=""}'
name:
as: ${1}_count
matches: ^(.*)_total$
resources:
overrides:
namespace:
resource: namespace
pod:
resource: pod
metricsQuery: 'sum(vertica_queued_requests_total) by (namespace, pod)'
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ commands:
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)
# 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_count)
OUTPUT=$(echo $RESULT | jq -r '.items[0].value')
# verify the metrics result
if [[ "$OUTPUT" == "" ]]; then
echo "empty custom metrics result on vertica_queued_requests_count. Result: $RESULT"
exit 1
fi
Loading