From 1f43fbb2d71fc4e16e483f53b8e6edc824d99e59 Mon Sep 17 00:00:00 2001 From: Hao Date: Thu, 16 Jan 2025 00:08:10 +0800 Subject: [PATCH] Prometheus adapter custom time range (#1033) Update Developer doc with customize interval explanation. Add example of VerticaAutoscaler under sample. --- DEVELOPER.md | 1 + ...eta1_verticaautoscaler_custom_metrics.yaml | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 config/samples/v1beta1_verticaautoscaler_custom_metrics.yaml diff --git a/DEVELOPER.md b/DEVELOPER.md index e55e44a5f..4339b23c6 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -591,6 +591,7 @@ A Prometheus service is running and accessible through an URL. 2. Configuration Customize the adapter configuration to map Prometheus metrics to Kubernetes metrics. For example, you can configure rules to map a Prometheus query (e.g., vertica_query_requests_attempted_total) to a Kubernetes metric. + To customize the interval of a query, change the interval value "5m" on the metricsQuery to the prefered time range. ```shell rules: diff --git a/config/samples/v1beta1_verticaautoscaler_custom_metrics.yaml b/config/samples/v1beta1_verticaautoscaler_custom_metrics.yaml new file mode 100644 index 000000000..ce364f45a --- /dev/null +++ b/config/samples/v1beta1_verticaautoscaler_custom_metrics.yaml @@ -0,0 +1,22 @@ +apiVersion: vertica.com/v1beta1 +kind: VerticaAutoscaler +metadata: + name: as-sample-custom-metrics +spec: + verticaDBName: verticadb-sample + # The serviceName should be the name of your subcluster + serviceName: sc1 + scalingGranularity: Pod + customAutoscalerSpec: + minReplicas: 3 + maxReplicas: 10 + metrics: + - metric: + type: Pods + pods: + metric: + # The name of the mapped Kubernetes metric name + name: vertica_query_requests_attempted_rate_per_second + target: + type: AverageValue + averageValue: 20000m \ No newline at end of file