You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-apps/java-metrics-scale-with-keda.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,13 +56,13 @@ Use the following steps to define environment variables and set up the environme
56
56
## Set up a managed identity for your Azure Container Apps
57
57
To scale with Azure Container Apps platform metrics, you need a managed identity to access metrics from Azure Monitor.
58
58
59
-
1. Create a user-assigned identity and assign it to your Azure Container Apps. You can follow the doc [Add a user-assigned identity](./managed-identity.md#add-a-user-assigned-identity). After you create the identity, run the CLI command to set the identity ID.
59
+
1. Create a user-assigned identity and assign it to your Azure Container Apps. You can follow the doc [add a user-assigned identity](./managed-identity.md#add-a-user-assigned-identity). After you create the identity, run the CLI command to set the identity ID.
2. Grant the `Monitoring Reader` role for your managed identity to read data from Azure Monitor. You can find more details about the roles for Azure Monitor in [Built-in Role Monitoring Reader](../role-based-access-control/built-in-roles/monitor.md#monitoring-reader).
65
+
2. Grant the `Monitoring Reader` role for your managed identity to read data from Azure Monitor. You can find more details about the roles for Azure Monitor in [Azure built-in roles for Monitor](../role-based-access-control/built-in-roles/monitor.md#monitoring-reader).
66
66
67
67
```azurecli
68
68
# Get the principal ID for your managed identity
@@ -75,7 +75,6 @@ To scale with Azure Container Apps platform metrics, you need a managed identity
75
75
To scale with Azure Monitor metrics, you can refer to [Azure Monitor KEDA scaler](https://keda.sh/docs/2.16/scalers/azure-monitor/) to define your Container Apps scale rule.
76
76
77
77
Here's a list of core metadata to set up the scale rule.
| tenantId | ID of the tenant that contains the Azure resource. |
@@ -90,7 +89,7 @@ Here's a list of core metadata to set up the scale rule.
90
89
91
90
92
91
93
-
Add a scale rule with [metrics from Azure Container Apps](./metrics.md) for your application.
92
+
Add a scale rule with [Azure Monitor metrics for Azure Container Apps](./metrics.md) for your application.
94
93
95
94
### [Azure CLI](#tab/azurecli)
96
95
@@ -153,7 +152,7 @@ az containerapp update \
153
152
154
153
This command adds a scale rule to your container app with the name `scale-with-azure-monitor-metrics`
155
154
- The scale type is set to `azure-monitor`.
156
-
- It uses the managed identity with resource ID `USER_ASSIGNED_IDENTITY_ID` to authenticate with Azure Monitor and query metrics for your container app.
155
+
- KEDA uses the managed identity with resource ID `USER_ASSIGNED_IDENTITY_ID` to authenticate with Azure Monitor and query metrics for your container app.
157
156
- KEDA queries the metric `JvmGcCount`, and aggregates the metric values within 1 minute with aggregation type`Total`.
158
157
- The target value is set to `30`, which means KEDA calculates the `desiredReplicas` using `ceil(AggregatedMetricValue(JvmGcCount)/30)`.
159
158
@@ -171,22 +170,22 @@ Here's a sample metric snapshot for the example scale rule.
171
170
:::image type="content" source="media/java-metrics-keda/keda-auto-scale-java-gc-portal.png" alt-text="Screenshot of KEDA scale with JVM metrics" lightbox="media/java-metrics-keda/keda-auto-scale-java-gc-portal.png":::
172
171
173
172
1. Initially, there's one replica (the `minReplicas`) for the app.
174
-
1. A spike in requests causes the replica to experience frequent JVM garbage collection (GC).
173
+
1. A spike in requests causes the Java app to experience frequent JVM garbage collection (GC).
175
174
1. KEDA observes the aggregated metric value for `jvm.gc.count` is increased to 140 and calculates desiredReplicas as `ceil(140/30)` = 5.
176
175
1. KEDA scales out the container app's replica count to 5.
177
-
1. The traffic is distributed across more replicas, reducing the average GC count.
176
+
1. The http traffic is distributed across more replicas, reducing the average GC count.
178
177
1. The GC count further decreases when no requests are coming in.
179
178
1. After a cooldown period, KEDA scales the replica count down to `minReplicas=1`.
180
179
181
180
## Scale Log
182
181
183
-
To view the KEDA scale logs, you can run the query in`Logs`.
182
+
To view the KEDA scale logs, you can run the query in`Logs` blade.
:::image type="content" source="media/java-metrics-keda/keda-auto-scale-java-log.png" alt-text="Screenshot of KEDA scale log query" lightbox="media/java-metrics-keda/keda-auto-scale-java-log.png":::
@@ -202,5 +201,5 @@ az group delete --resource-group $RESOURCE_GROUP
202
201
## Related content
203
202
204
203
> [!div class="nextstepaction"]
205
-
> [ Set scaling rules in Azure Container Apps](./scale-app.md)
206
-
> [ Java metrics for Azure Container Apps](./java-metrics.md)
204
+
- [Set scaling rules in Azure Container Apps](./scale-app.md)
205
+
- [Java metrics for Azure Container Apps](./java-metrics.md)
0 commit comments