Skip to content

Commit

Permalink
Updated KEDA with tips and tricks
Browse files Browse the repository at this point in the history
  • Loading branch information
sqtran committed May 13, 2024
1 parent b87353d commit c5533ff
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions _posts/2024-03-15-Custom-Metrics_Autoscaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
authModes: bearer
metricName: http_server_active_requests
namespace: steve-keda
query: sum(http_server_active_requests)
query: sum(http_server_active_requests{job="optionally-filter-on-your-deployment"})
serverAddress: 'https://thanos-querier.openshift-monitoring.svc.cluster.local:9092'
threshold: '5'
type: prometheus
Expand Down Expand Up @@ -329,4 +329,12 @@ metadata:
name: openshift-keda-6sjcw
namespace: openshift-keda
spec: {}
```
```

# Tips and Tricks

If the auto-scaler doesn't appear to be working, check the Horizontal Pod Autoscaler Tab and verify that the PromQL query in your ScaledObject is correct. The active count should fluctuate under load, during the specified interval (make sure you're putting it under load for at least that scrape interval).

If unsure about query syntax, run the PromQL query in the Metrics Tab. Any ad-hoc query can be entered there, to verify the syntax or metric name is correct.

Make sure the filter is set `{job="your_deployment"}` to avoid metric name collision when aggregating results. This is important when multiple applications are producing the same metric in the same namespace.

0 comments on commit c5533ff

Please sign in to comment.