az monitor app-insights metrics
Note
This reference is part of the application-insights extension for the Azure CLI (version 2.55.0 or higher). The extension will automatically install the first time you run an az monitor app-insights metrics command. Learn more about extensions.
Retrieve metrics from an application.
Commands
Name | Description | Type | Status |
---|---|---|---|
az monitor app-insights metrics get-metadata |
Get the metadata for metrics on a particular application. |
Extension | GA |
az monitor app-insights metrics show |
View the value of a single metric. |
Extension | GA |
az monitor app-insights metrics get-metadata
Get the metadata for metrics on a particular application.
az monitor app-insights metrics get-metadata [--app]
[--ids]
[--resource-group]
[--subscription]
Examples
Views the metadata for the provided app.
az monitor app-insights metrics get-metadata --app e292531c-eb03-4079-9bb0-fe6b56b99f8b
Optional Parameters
GUID, app name, or fully-qualified Azure resource name of Application Insights component. The application GUID may be acquired from the API Access menu item on any Application Insights resource in the Azure portal. If using an application name, please specify resource group.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
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 app-insights metrics show
View the value of a single metric.
az monitor app-insights metrics show --metrics
[--aggregation]
[--app]
[--end-time]
[--filter]
[--ids]
[--interval]
[--offset]
[--orderby]
[--resource-group]
[--segment]
[--start-time]
[--subscription]
[--top]
Examples
View the count of availabilityResults events.
az monitor app-insights metrics show --app e292531c-eb03-4079-9bb0-fe6b56b99f8b --metric availabilityResults/count
Required Parameters
The metric to retrieve. May be either a standard AI metric or an application-specific custom metric.
Optional Parameters
The aggregation to use when computing the metric values. To retrieve more than one aggregation at a time, separate them with a comma. If no aggregation is specified, then the default aggregation for the metric is used.
GUID, app name, or fully-qualified Azure resource name of Application Insights component. The application GUID may be acquired from the API Access menu item on any Application Insights resource in the Azure portal. If using an application name, please specify resource group.
End of time range for current operation. Defaults to the current time. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
An expression used to filter the results. This value should be a valid OData filter expression where the keys of each clause should be applicable dimensions for the metric you are retrieving.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The interval over which to aggregate metrics, in ##h##m format.
Time offset of the query range, in ##d##h format.
Can be used with either --start-time or --end-time. If used with --start-time, then the end time will be calculated by adding the offset. If used with --end-time (default), then the start time will be calculated by subtracting the offset. If --start-time and --end-time are provided, then --offset will be ignored.
The aggregation function and direction to sort the segments by. This value is only valid when segment is specified.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The name of the dimension to segment the metric values by. This dimension must be applicable to the metric you are retrieving. To segment by more than one dimension at a time, separate them with a comma (,). In this case, the metric data will be segmented in the order the dimensions are listed in the parameter.
Start-time of time range for which to retrieve data. Format: date (yyyy-mm-dd) time (hh:mm:ss.xxxxx) timezone (+/-hh:mm).
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The number of segments to return. This value is only valid when segment is specified.
Global Parameters
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.
Azure CLI