az monitor metrics
View Azure resource metrics.
Commands
az monitor metrics alert |
Manage near-realtime metric alert rules. |
az monitor metrics alert condition |
Manage near-realtime metric alert rule conditions. |
az monitor metrics alert condition create |
Build a metric alert rule condition. |
az monitor metrics alert create |
Create a metric-based alert rule. |
az monitor metrics alert delete |
Delete a metrics-based alert rule. |
az monitor metrics alert dimension |
Manage near-realtime metric alert rule dimensions. |
az monitor metrics alert dimension create |
Build a metric alert rule dimension. |
az monitor metrics alert list |
List metric-based alert rules. |
az monitor metrics alert show |
Show a metrics-based alert rule. |
az monitor metrics alert update |
Update a metric-based alert rule. |
az monitor metrics list |
List the metric values for a resource. |
az monitor metrics list-definitions |
List the metric definitions for the resource. |
az monitor metrics list-namespaces |
List the metric namespaces for the resource. |
az monitor metrics list
List the metric values for a resource.
az monitor metrics list --resource
[--aggregation {Average, Count, Maximum, Minimum, None, Total}]
[--dimension]
[--end-time]
[--filter]
[--interval]
[--metadata]
[--metrics]
[--namespace]
[--offset]
[--orderby]
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
[--start-time]
[--top]
Examples
List a VM's CPU usage for the past hour
az monitor metrics list --resource {ResourceName} --metric "Percentage CPU"
List success E2E latency of a storage account and split the data series based on API name
az monitor metrics list --resource {ResourceName} --metric SuccessE2ELatency \
--dimension ApiName
List success E2E latency of a storage account and split the data series based on both API name and geo type
az monitor metrics list --resource {ResourceName} --metric SuccessE2ELatency \
--dimension ApiName GeoType
List success E2E latency of a storage account and split the data series based on both API name and geo type using "--filter" parameter
az monitor metrics list --resource {ResourceName} --metric SuccessE2ELatency \
--filter "ApiName eq '*' and GeoType eq '*'"
List success E2E latency of a storage account and split the data series based on both API name and geo type. Limits the api name to 'DeleteContainer'
az monitor metrics list --resource {ResourceName} --metric SuccessE2ELatency \
--filter "ApiName eq 'DeleteContainer' and GeoType eq '*'"
List transactions of a storage account per day since 2017-01-01
az monitor metrics list --resource {ResourceName} --metric Transactions \
--start-time 2017-01-01T00:00:00Z \
--interval PT24H
List the metadata values for a storage account under transaction metric's api name dimension since 2017
az monitor metrics list --resource {ResourceName} --metric Transactions \
--filter "ApiName eq '*'" \
--start-time 2017-01-01T00:00:00Z
Required Parameters
Name or ID of the target resource.
Optional Parameters
The list of aggregation types (space-separated) to retrieve.
The list of dimensions (space-separated) the metrics are queried into.
End time of the query. Defaults to the current time. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
A string used to reduce the set of metric data returned. eg. "BlobType eq '*'".
The interval over which to aggregate metrics, in ##h##m format.
Returns the metadata values instead of metric data.
Space-separated list of metric names to retrieve.
Namespace to query metric definitions for.
Time offset of the query range, in ##d##h format.
Aggregation to use for sorting results and the direction of the sort. Only one order can be specificed. Examples: sum asc.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
Start time of the query. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
Max number of records to retrieve. Valid only if --filter used.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az monitor metrics list-definitions
List the metric definitions for the resource.
az monitor metrics list-definitions --resource
[--namespace]
[--resource-group]
[--resource-namespace]
[--resource-parent]
[--resource-type]
Examples
List the metric definitions for the resource. (autogenerated)
az monitor metrics list-definitions --resource /subscriptions/{subscriptionID}/resourceGroups/{resourceGroup}/Microsoft.Network/networkSecurityGroups/{resourceName}
Required Parameters
Name or ID of the target resource.
Optional Parameters
Namespace to query metric definitions for.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Target resource provider namespace.
Target resource parent path, if applicable.
Target resource type. Can also accept namespace/type format (Ex: 'Microsoft.Compute/virtualMachines').
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az monitor metrics list-namespaces
List the metric namespaces for the resource.
az monitor metrics list-namespaces --resource-uri
[--start-time]
Examples
List the metric namespaces for the resource.
az monitor metrics list-namespaces --resource /subscriptions/{subscriptionID}/resourceGroups/{resourceGroup}/Microsoft.Network/networkSecurityGroups/{resourceName} --start-time 2021-03-01T00:00:00Z
Required Parameters
The identifier of the resource. Required.
Optional Parameters
Start time of the query. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Feedback
Submit and view feedback for