-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Export Trino metrics to Prometheus and enable autoscalling with…
… KEDA (#712) Co-authored-by: Ratnopam Charabarti <ratnopamc@yahoo.com>
- Loading branch information
Showing
7 changed files
with
184 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
distributed-databases/trino/helm-values/kube-prometheus-amp-enable.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
prometheus: | ||
serviceAccount: | ||
create: true | ||
name: ${amp_sa} | ||
annotations: | ||
eks.amazonaws.com/role-arn: ${amp_irsa} | ||
prometheusSpec: | ||
remoteWrite: | ||
- url: ${amp_remotewrite_url} | ||
sigv4: | ||
region: ${region} | ||
queue_config: | ||
max_samples_per_send: 1000 | ||
max_shards: 200 | ||
capacity: 2500 | ||
retention: 5h | ||
scrapeInterval: 30s | ||
evaluationInterval: 30s | ||
scrapeTimeout: 10s | ||
storageSpec: | ||
volumeClaimTemplate: | ||
metadata: | ||
name: data | ||
spec: | ||
storageClassName: gp2 | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 50Gi | ||
serviceMonitorSelectorNilUsesHelmValues: false | ||
alertmanager: | ||
enabled: false | ||
|
||
grafana: | ||
enabled: true | ||
defaultDashboardsEnabled: true | ||
# Adding AMP datasource to Grafana config | ||
serviceAccount: | ||
create: false | ||
name: ${amp_sa} | ||
grafana.ini: | ||
auth: | ||
sigv4_auth_enabled: true | ||
additionalDataSources: | ||
- name: AMP | ||
editable: true | ||
jsonData: | ||
sigV4Auth: true | ||
sigV4Region: ${region} | ||
type: prometheus | ||
isDefault: false | ||
url: ${amp_url} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: keda-scaler-trino-worker | ||
namespace: ${trino_namespace} | ||
spec: | ||
scaleTargetRef: | ||
name: trino-worker | ||
minReplicaCount: 3 | ||
maxReplicaCount: 15 | ||
pollingInterval: 30 # Seconds | ||
cooldownPeriod: 600 # Seconds | ||
fallback: | ||
failureThreshold: 3 | ||
replicas: 6 | ||
advanced: | ||
horizontalPodAutoscalerConfig: | ||
behavior: | ||
scaleDown: | ||
stabilizationWindowSeconds: 600 | ||
policies: | ||
- type: Pods | ||
value: 1 | ||
periodSeconds: 300 | ||
scaleUp: | ||
stabilizationWindowSeconds: 0 | ||
policies: | ||
- type: Pods | ||
value: 1 | ||
periodSeconds: 120 | ||
triggers: | ||
- type: cpu | ||
metricType: Utilization | ||
metadata: | ||
value: '80' # Target CPU utilization percentage | ||
- type: prometheus | ||
metricType: Value | ||
metadata: | ||
serverAddress: http://kube-prometheus-stack-prometheus.kube-prometheus-stack.svc.cluster.local:9090 | ||
threshold: '1' | ||
metricName: queued_queries | ||
query: sum by (job) (avg_over_time(trino_execution_QueryManager_QueuedQueries{job="trino"}[1m])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters