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
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,11 +94,11 @@ Here's a list of core metadata to set up the scale rule.
94
94
| metricAggregationInterval | Collection time of the metric in format "hh:mm:ss" (Default: "0:5:0", Optional) |
95
95
| targetValue | Target value to trigger scaling actions. (This value can be a float) |
96
96
97
-
### Example
97
+
98
98
99
99
Add a scale rule with [metrics from Azure Container Apps](./metrics.md) for your application.
100
100
101
-
# [Azure CLI](#tab/azurecli)
101
+
### [Azure CLI](#tab/azurecli)
102
102
103
103
```azurecli
104
104
az containerapp update \
@@ -119,7 +119,7 @@ az containerapp update \
119
119
--scale-rule-identity $USER_ASSIGNED_IDENTITY_ID
120
120
```
121
121
122
-
# [ARM Template](#tab/arm-template)
122
+
### [ARM Template](#tab/arm-template)
123
123
124
124
```json
125
125
{
@@ -147,17 +147,21 @@ az containerapp update \
147
147
"identity": "<your-managed-identity-id>"
148
148
}
149
149
}
150
-
]
150
+
]
151
151
}
152
152
}
153
153
}
154
154
}
155
155
}
156
156
```
157
157
158
+
---
158
159
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)`.
161
165
162
166
> [!NOTE]
163
167
> 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.
184
188
185
189
To view the KEDA scale logs, you can run the query in`Logs`.
:::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":::
0 commit comments