Skip to content

Commit db58b90

Browse files
committed
fix
1 parent a6d871d commit db58b90

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ Here's a list of core metadata to set up the scale rule.
9494
| metricAggregationInterval | Collection time of the metric in format "hh:mm:ss" (Default: "0:5:0", Optional) |
9595
| targetValue | Target value to trigger scaling actions. (This value can be a float) |
9696

97-
### Example
97+
9898

9999
Add a scale rule with [metrics from Azure Container Apps](./metrics.md) for your application.
100100

101-
# [Azure CLI](#tab/azurecli)
101+
### [Azure CLI](#tab/azurecli)
102102

103103
```azurecli
104104
az containerapp update \
@@ -119,7 +119,7 @@ az containerapp update \
119119
--scale-rule-identity $USER_ASSIGNED_IDENTITY_ID
120120
```
121121

122-
# [ARM Template](#tab/arm-template)
122+
### [ARM Template](#tab/arm-template)
123123

124124
```json
125125
{
@@ -147,17 +147,21 @@ az containerapp update \
147147
"identity": "<your-managed-identity-id>"
148148
}
149149
}
150-
]
150+
]
151151
}
152152
}
153153
}
154154
}
155155
}
156156
```
157157

158+
---
158159

159-
160-
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)`.
160+
This command adds a scale rule to your container app with the name `scale-with-azure-monitor-metrics`
161+
- The scale type is set to `azure-monitor`.
162+
- It uses the managed identity with resource ID `USER_ASSIGNED_IDENTITY_ID` to authenticate with Azure Monitor and query metrics for your container app.
163+
- KEDA queries the metric `JvmGcCount`, and aggregates the metric values within 1 minute with aggregation type `Total`.
164+
- The target value is set to `30`, which means KEDA calculates the `desiredReplicas` using `ceil(AggregatedMetricValue(JvmGcCount)/30)`.
161165

162166
> [!NOTE]
163167
> The metric `JvmGcCount` is only used as an example. You can use any metric from Azure Monitor. Before setting up the scale rule, view the metrics in the Azure portal to determine the appropriate metric, aggregation interval, and target value based on your application's requirements. Additionally, consider using the built-in [HTTP/TCP scale rules](./scale-app.md#http), which can meet most common scaling scenarios, before opting for a custom metric.
@@ -184,12 +188,12 @@ Here's a sample metric snapshot for the example scale rule.
184188

185189
To view the KEDA scale logs, you can run the query in `Logs`.
186190

187-
```kusto
191+
```kusto
188192
ContainerAppSystemLogs
189193
| where RevisionName == "<your-revision>"
190194
| where EventSource == "KEDA"
191195
| project TimeGenerated, Type, Reason, ContainerAppName, Log
192-
```
196+
```
193197

194198
:::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":::
195199

0 commit comments

Comments
 (0)