Skip to main content

metrics_at_subscription_scopes

Creates, updates, deletes, gets or lists a metrics_at_subscription_scopes resource.

Overview

Namemetrics_at_subscription_scopes
TypeResource
Idazure.monitor.metrics_at_subscription_scopes

Fields

The following fields are returned by SELECT queries:

Successful request to get the list of metric values.

NameDatatypeDescription
idstringThe metric Id.
nameobjectThe name and the display name of the metric, i.e. it is localizable string.
displayDescriptionstringDetailed description of this metric.
errorCodestring'Success' or the error details on query failures for this metric.
errorMessagestringError message encountered querying this specific metric.
timeseriesarrayThe time series returned when a data query is performed.
typestringThe resource type of the metric resource.
unitstringThe unit of the metric.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectsubscriptionId, regiontimespan, interval, metricnames, aggregation, top, orderby, $filter, resultType, metricnamespace, AutoAdjustTimegrain, ValidateDimensions, rollupbyLists the metric data for a subscription.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringThe region where the metrics you want reside.
subscriptionIdstringThe ID of the target subscription.
$filterstringThe $filter is used to reduce the set of metric data returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’
- Invalid variant:
$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’
This is invalid because the logical or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’
- Return all time series where A = a1
$filter=A eq ‘a1’ and B eq ‘’ and C eq ‘.
AutoAdjustTimegrainbooleanWhen set to true, if the timespan passed in is not supported by this metric, the API will return the result using the closest supported timespan. When set to false, an error is returned for invalid timespan parameters. Defaults to false.
ValidateDimensionsbooleanWhen set to false, invalid filter parameter values will be ignored. When set to true, an error is returned for invalid filter parameters. Defaults to true.
aggregationstringThe list of aggregation types (comma separated) to retrieve.
intervalstringThe interval (i.e. timegrain) of the query in ISO 8601 duration format. Defaults to PT1M. Special case for 'FULL' value that returns single datapoint for entire time span requested. Examples: PT15M, PT1H, P1D, FULL
metricnamesstringThe names of the metrics (comma separated) to retrieve.
metricnamespacestringMetric namespace to query metric definitions for.
orderbystringThe aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum asc
resultTypestringReduces the set of data collected. The syntax allowed depends on the operation. See the operation's description for details.
rollupbystringDimension name(s) to rollup results by. For example if you only want to see metric values with a filter like 'City eq Seattle or City eq Tacoma' but don't want to see separate values for each city, you can specify 'RollUpBy=City' to see the results for Seattle and Tacoma rolled up into one timeseries.
timespanstringThe timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.
topinteger (int32)The maximum number of records to retrieve per resource ID in the request. Valid only if filter is specified. Defaults to 10.

SELECT examples

Lists the metric data for a subscription.

SELECT
id,
name,
displayDescription,
errorCode,
errorMessage,
timeseries,
type,
unit
FROM azure.monitor.metrics_at_subscription_scopes
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND region = '{{ region }}' -- required
AND timespan = '{{ timespan }}'
AND interval = '{{ interval }}'
AND metricnames = '{{ metricnames }}'
AND aggregation = '{{ aggregation }}'
AND top = '{{ top }}'
AND orderby = '{{ orderby }}'
AND $filter = '{{ $filter }}'
AND resultType = '{{ resultType }}'
AND metricnamespace = '{{ metricnamespace }}'
AND AutoAdjustTimegrain = '{{ AutoAdjustTimegrain }}'
AND ValidateDimensions = '{{ ValidateDimensions }}'
AND rollupby = '{{ rollupby }}'
;