Skip to content

Commit a6d871d

Browse files
committed
fix
1 parent 5f1d6a6 commit a6d871d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

articles/container-apps/java-metrics-scale-with-keda.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: cshoe
1515

1616
Azure Container Apps manages automatic horizontal scaling through a set of declarative scaling rules. You can create your own scale rules with [customized event sources](./scale-app.md#custom).
1717

18-
In this tutorial, you will add a custom scale rule to scale your container app with Java metrics and observe how your application scales.
18+
In this tutorial, you add a custom scale rule to scale your container app with Java metrics and observe how your application scales.
1919

2020
## Prerequisites
2121

@@ -47,7 +47,7 @@ Use the following steps to define environment variables and set up the environme
4747
| `APP_NAME` | The app name for your Azure Container Apps. |
4848
| `IDENTITY_NAME` | The name for your managed identity, which is assigned to your Azure Container Apps.|
4949
50-
1. Log in to Azure with the Azure CLI.
50+
1. Sign in to Azure with the Azure CLI.
5151
5252
```azurecli
5353
az login
@@ -62,13 +62,13 @@ Use the following steps to define environment variables and set up the environme
6262
## Set up a managed identity for your Azure Container Apps
6363
To scale with Azure Container Apps platform metrics, you need a managed identity to access metrics from Azure Monitor.
6464
65-
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 below CLI command to set the identity ID.
65+
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.
6666
6767
```azurecli
6868
USER_ASSIGNED_IDENTITY_ID=$(az identity show --resource-group $RESOURCE_GROUP --name $IDENTITY_NAME --query "id" --output tsv)
6969
```
7070
71-
2. Grant the `Monitoring Reader` role to your managed identity to read data from Azure Monitor. You can find more details about the RBAC for Azure Monitor in [Built-in Role Monitoring Reader](../role-based-access-control/built-in-roles/monitor.md#monitoring-reader).
71+
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).
7272
7373
```azurecli
7474
# Get the principal ID for your managed identity
@@ -80,12 +80,12 @@ To scale with Azure Container Apps platform metrics, you need a managed identity
8080
## Add a scale rule with Azure Monitor metrics
8181
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.
8282
83-
Here is a list of core metadata to set up the scale rule.
83+
Here's a list of core metadata to set up the scale rule.
8484

8585
| Metadata key | Description |
8686
|------------------------------------|-------------------------------------------------------------------------------------------------------|
87-
| tenantId | ID of the tenant that contains the Azure resource. This is used for authentication. |
88-
| subscriptionId | ID of the Azure subscription that contains the Azure resource. This is used for determining the full resource URI. |
87+
| tenantId | ID of the tenant that contains the Azure resource. |
88+
| subscriptionId | ID of the Azure subscription that contains the Azure resource. |
8989
| resourceGroupName | Name of the resource group for the Azure resource. |
9090
| resourceURI | Shortened URI to the Azure resource with format `<resourceProviderNamespace>/<resourceType>/<resourceName>`. |
9191
| metricName | Name of the metric to query. |
@@ -155,6 +155,8 @@ az containerapp update \
155155
}
156156
```
157157

158+
159+
158160
This command adds a scale rule to your container app with the name `scale-with-azure-monitor-metrics`, and the scale type is set to `azure-monitor`. It uses the managed identity with resource ID `USER_ASSIGNED_IDENTITY_ID` to authenticate with Azure Monitor and query metrics for your container app. In the example, KEDA queries the metric `JvmGcCount`, and aggregates the metric values within 1 minute with aggregation type `Total`. The target value is set to `30`, which means KEDA calculates the `desiredReplicas` using `ceil(AggregatedMetricValue(JvmGcCount)/30)`.
159161

160162
> [!NOTE]
@@ -166,11 +168,11 @@ Once your new revision is ready, [send requests](./tutorial-scaling.md#send-requ
166168
1. Add your metric `jvm.gc.count`, with filter `Revision=<your-revision>` and split by `Replica`.
167169
1. Add the metric `Replica Count`, with filter `Revision=<your-revision>`.
168170
169-
Here is a sample metric snapshot for the example scale rule.
171+
Here's a sample metric snapshot for the example scale rule.
170172

171173
:::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":::
172174

173-
1. Initially, there is 1 replica (the `minReplicas`) for the app.
175+
1. Initially, there's one replica (the `minReplicas`) for the app.
174176
1. A spike in requests causes the replica to experience frequent JVM garbage collection (GC).
175177
1. KEDA observes the aggregated metric value for `jvm.gc.count` is increased to 140 and calculates desiredReplicas as `ceil(140/30)` = 5.
176178
1. KEDA scales out the container app's replica count to 5.
@@ -180,7 +182,7 @@ Here is a sample metric snapshot for the example scale rule.
180182

181183
## Scale Log
182184

183-
To view the KEDA scale logs, you can run the below query in `Logs`.
185+
To view the KEDA scale logs, you can run the query in `Logs`.
184186

185187
```kusto
186188
ContainerAppSystemLogs

0 commit comments

Comments
 (0)