Skip to content

Commit

Permalink
dapr example: http scaler
Browse files Browse the repository at this point in the history
Signed-off-by: Jirka Kremser <jiri.kremser@gmail.com>
  • Loading branch information
jkremser committed Dec 2, 2024
1 parent dd54d76 commit 74751f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 5 additions & 6 deletions examples/dapr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ SO

## Scaling Behavior

Each replica of `pythonapp` microservice calls the `nodeapp` microservice each second. Checke the following part of the ScaledObject:
```yaml
metricQuery: 'sum(runtime_service_invocation_req_recv_total{app_id="nodeapp",src_app_id="pythonapp"})'
operationOverTime: 'rate'
```
Each replica of the pythonapp microservice makes a call to the nodeapp microservice every second. Check the following
part of the ScaledObject configuration:

```yaml
metricQuery: 'sum(runtime_service_invocation_req_recv_total{app_id="nodeapp",src_app_id="pythonapp"})'
operationOverTime: 'rate'
```
- The runtime_service_invocation_req_recv_total metric increments each time the `pythonapp` calls `nodeapp`.
- One of the metric dimensions is the pod identity, meaning each pod exposes these metrics with its label attached.
- Similar to PromQL, if not all dimensions are specified, multiple metric series will be returned.
Expand Down
9 changes: 8 additions & 1 deletion examples/dapr/nodeapp-so-v3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ spec:
clampMax: '10'
- type: kedify-http
metadata:
# todo:
trafficAutowire: service
service: nodeapp-dapr
fallbackService: nodeapp-dapr-original
portName: dapr-http
hosts: nodeapp-dapr.default.svc.cluster.local
scalingMetric: requestRate
targetValue: '10000'

minReplicaCount: 0
advanced:
horizontalPodAutoscalerConfig:
Expand Down

0 comments on commit 74751f1

Please sign in to comment.