Metrics Batch - Batch

Lists the metric values for multiple resources.

POST {endpoint}/subscriptions/{subscriptionId}/metrics:getBatch?metricnamespace={metricnamespace}&metricnames={metricnames}&api-version=2023-10-01
POST {endpoint}/subscriptions/{subscriptionId}/metrics:getBatch?starttime={starttime}&endtime={endtime}&interval={interval}&metricnamespace={metricnamespace}&metricnames={metricnames}&aggregation={aggregation}&top={top}&orderby={orderby}&filter={filter}&rollupby={rollupby}&api-version=2023-10-01

URI Parameters

Name In Required Type Description
endpoint
path True

string

url

The regional endpoint to use, for example https://eastus.metrics.monitor.azure.com. The region should match the region of the requested resources. For global resources, the region should be 'global'.

subscriptionId
path True

string

uuid

The subscription identifier for the resources in this batch.

api-version
query True

string

Client Api Version.

metricnames
query True

string[]

The names of the metrics (comma separated) to retrieve.

metricnamespace
query True

string

Metric namespace that contains the requested metric names.

aggregation
query

string

The list of aggregation types (comma separated) to retrieve. Examples: average, minimum, maximum

endtime
query

string

The end time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'.

filter
query

string

The 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 ‘.

interval
query

string

The 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

orderby
query

string

The aggregation to use for sorting results and the direction of the sort. Only one order can be specified. Examples: sum asc

rollupby
query

string

Dimension 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.

starttime
query

string

The start time of the query. It is a string in the format 'yyyy-MM-ddTHH:mm:ss.fffZ'. If you have specified the endtime parameter, then this parameter is required. If only starttime is specified, then endtime defaults to the current time. If no time interval is specified, the default is 1 hour.

top
query

integer

int32

The maximum number of records to retrieve per resource ID in the request. Valid only if filter is specified. Defaults to 10.

Request Body

Name Type Description
resourceids

string[]

The list of resource IDs to query metrics for.

Responses

Name Type Description
200 OK

MetricResultsResponse

The response to a metrics query.

Other Status Codes

ErrorResponse

Describes the format of Error response.

Headers

x-ms-error-code: string

Security

AADToken

Azure Active Directory OAuth2 Authentication

Type: oauth2
Flow: application
Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Scopes

Name Description
https://metrics.monitor.azure.com/.default https://metrics.monitor.azure.com/.default

Examples

Query Redis Metrics summary
Query Storage Metrics

Query Redis Metrics summary

Sample Request

POST {endpoint}/subscriptions/12345678-abcd-1234-abcd-123456789abc/metrics:getBatch?starttime=2023-11-07T14:00:00.000Z&endtime=2023-11-07T18:00:00.000Z&interval=FULL&metricnamespace=Microsoft.Cache/Redis&metricnames=cacheWrite&aggregation=average&top=10&orderby=average desc&filter=ShardId eq '0'&rollupby=ShardId&api-version=2023-10-01

{
  "resourceids": [
    "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis5",
    "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis3",
    "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis2"
  ]
}

Sample Response

{
  "values": [
    {
      "starttime": "2023-11-07T14:00:00Z",
      "endtime": "2023-11-07T18:00:00Z",
      "interval": "PT4H",
      "value": [
        {
          "id": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis5/providers/Microsoft.Insights/metrics/cacheWrite",
          "type": "Microsoft.Insights/metrics",
          "name": {
            "value": "cacheWrite",
            "localizedValue": "Cache Write"
          },
          "displayDescription": "The amount of data written to the cache in bytes per second. For more details, see https://aka.ms/redis/metrics.",
          "unit": "BytesPerSecond",
          "timeseries": [
            {
              "metadatavalues": [],
              "data": [
                {
                  "timeStamp": "2023-11-07T14:00:00Z",
                  "average": 35513.760416666664
                }
              ]
            }
          ],
          "errorCode": "Success"
        }
      ],
      "namespace": "microsoft.cache/redis",
      "resourceregion": "westus2",
      "resourceid": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis5"
    },
    {
      "starttime": "2023-11-07T14:00:00Z",
      "endtime": "2023-11-07T18:00:00Z",
      "interval": "PT4H",
      "value": [
        {
          "id": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis3/providers/Microsoft.Insights/metrics/cacheWrite",
          "type": "Microsoft.Insights/metrics",
          "name": {
            "value": "cacheWrite",
            "localizedValue": "Cache Write"
          },
          "displayDescription": "The amount of data written to the cache in bytes per second. For more details, see https://aka.ms/redis/metrics.",
          "unit": "BytesPerSecond",
          "timeseries": [
            {
              "metadatavalues": [],
              "data": [
                {
                  "timeStamp": "2023-11-07T14:00:00Z",
                  "average": 7135.0625
                }
              ]
            }
          ],
          "errorCode": "Success"
        }
      ],
      "namespace": "microsoft.cache/redis",
      "resourceregion": "westus2",
      "resourceid": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis3"
    },
    {
      "starttime": "2023-11-07T14:00:00Z",
      "endtime": "2023-11-07T18:00:00Z",
      "interval": "PT4H",
      "value": [
        {
          "id": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis2/providers/Microsoft.Insights/metrics/cacheWrite",
          "type": "Microsoft.Insights/metrics",
          "name": {
            "value": "cacheWrite",
            "localizedValue": "Cache Write"
          },
          "displayDescription": "The amount of data written to the cache in bytes per second. For more details, see https://aka.ms/redis/metrics.",
          "unit": "BytesPerSecond",
          "timeseries": [
            {
              "metadatavalues": [],
              "data": [
                {
                  "timeStamp": "2023-11-07T14:00:00Z",
                  "average": 6723.489583333333
                }
              ]
            }
          ],
          "errorCode": "Success"
        }
      ],
      "namespace": "microsoft.cache/redis",
      "resourceregion": "westus2",
      "resourceid": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/test_redis/providers/Microsoft.Cache/Redis/redis2"
    }
  ]
}
x-ms-error-code: BadRequest
{
  "error": {
    "additionalInfo": [
      {
        "type": "string",
        "info": "TraceId=dd033ebf1e260d815f4bccad149bbc15"
      },
      {
        "type": "string",
        "info": "ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException"
      }
    ],
    "code": "BadRequest",
    "message": "Detected invalid time range parameters for API version 2023-10-01. Please use only starttime and endtime to specify a time range."
  }
}

Query Storage Metrics

Sample Request

POST {endpoint}/subscriptions/12345678-abcd-1234-abcd-123456789abc/metrics:getBatch?starttime=2023-02-01T20:00:00.123Z&endtime=2023-02-01T23:00:00.345Z&interval=PT15M&metricnamespace=Microsoft.Storage/storageAccounts&metricnames=Ingress,Egress&aggregation=average,minimum,maximum&top=10&orderby=average desc&filter=ApiName eq 'GetBlob' or ApiName eq 'GetBlobServiceProperties' and Authentication eq '*'&api-version=2023-10-01

{
  "resourceids": [
    "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1",
    "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2"
  ]
}

Sample Response

{
  "values": [
    {
      "starttime": "2023-02-01T20:00:00.123Z",
      "endtime": "2023-02-01T23:00:00.345Z",
      "interval": "PT15M",
      "value": [
        {
          "id": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Ingress",
          "type": "Microsoft.Insights/metrics",
          "name": {
            "value": "Ingress",
            "localizedValue": "Ingress"
          },
          "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.",
          "unit": "Bytes",
          "timeseries": [
            {
              "metadatavalues": [
                {
                  "name": {
                    "value": "apiname",
                    "localizedValue": "apiname"
                  },
                  "value": "GetBlob"
                },
                {
                  "name": {
                    "value": "authentication",
                    "localizedValue": "authentication"
                  },
                  "value": "SAS"
                }
              ],
              "data": [
                {
                  "timeStamp": "2023-02-01T20:00:00Z",
                  "average": 437,
                  "minimum": 437,
                  "maximum": 437
                },
                {
                  "timeStamp": "2023-02-01T20:15:00Z",
                  "average": 438.0735294117647,
                  "minimum": 437,
                  "maximum": 583
                },
                {
                  "timeStamp": "2023-02-01T20:30:00Z",
                  "average": 437,
                  "minimum": 437,
                  "maximum": 437
                },
                {
                  "timeStamp": "2023-02-01T20:45:00Z",
                  "average": 437.54477611940297,
                  "minimum": 437,
                  "maximum": 583
                },
                {
                  "timeStamp": "2023-02-01T21:00:00Z",
                  "average": 437,
                  "minimum": 437,
                  "maximum": 437
                },
                {
                  "timeStamp": "2023-02-01T21:15:00Z",
                  "average": 438.0735294117647,
                  "minimum": 437,
                  "maximum": 583
                },
                {
                  "timeStamp": "2023-02-01T21:30:00Z",
                  "average": 437,
                  "minimum": 437,
                  "maximum": 437
                },
                {
                  "timeStamp": "2023-02-01T21:45:00Z",
                  "average": 437.54477611940297,
                  "minimum": 437,
                  "maximum": 583
                },
                {
                  "timeStamp": "2023-02-01T22:00:00Z",
                  "average": 437,
                  "minimum": 437,
                  "maximum": 437
                },
                {
                  "timeStamp": "2023-02-01T22:15:00Z",
                  "average": 438.0735294117647,
                  "minimum": 437,
                  "maximum": 583
                },
                {
                  "timeStamp": "2023-02-01T22:30:00Z",
                  "average": 437,
                  "minimum": 437,
                  "maximum": 437
                },
                {
                  "timeStamp": "2023-02-01T22:45:00Z",
                  "average": 437.542750929368,
                  "minimum": 437,
                  "maximum": 583
                }
              ]
            },
            {
              "metadatavalues": [
                {
                  "name": {
                    "value": "apiname",
                    "localizedValue": "apiname"
                  },
                  "value": "GetBlobServiceProperties"
                },
                {
                  "name": {
                    "value": "authentication",
                    "localizedValue": "authentication"
                  },
                  "value": "AccountKey"
                }
              ],
              "data": [
                {
                  "timeStamp": "2023-02-01T20:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:00:00Z",
                  "average": 342,
                  "minimum": 342,
                  "maximum": 342
                },
                {
                  "timeStamp": "2023-02-01T22:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:45:00Z"
                }
              ]
            }
          ],
          "errorCode": "Success"
        },
        {
          "id": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1/providers/Microsoft.Insights/metrics/Egress",
          "type": "Microsoft.Insights/metrics",
          "name": {
            "value": "Egress",
            "localizedValue": "Egress"
          },
          "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.",
          "unit": "Bytes",
          "timeseries": [
            {
              "metadatavalues": [
                {
                  "name": {
                    "value": "apiname",
                    "localizedValue": "apiname"
                  },
                  "value": "GetBlobServiceProperties"
                },
                {
                  "name": {
                    "value": "authentication",
                    "localizedValue": "authentication"
                  },
                  "value": "AccountKey"
                }
              ],
              "data": [
                {
                  "timeStamp": "2023-02-01T20:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:00:00Z",
                  "average": 796,
                  "minimum": 796,
                  "maximum": 796
                },
                {
                  "timeStamp": "2023-02-01T22:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:45:00Z"
                }
              ]
            },
            {
              "metadatavalues": [
                {
                  "name": {
                    "value": "apiname",
                    "localizedValue": "apiname"
                  },
                  "value": "GetBlob"
                },
                {
                  "name": {
                    "value": "authentication",
                    "localizedValue": "authentication"
                  },
                  "value": "SAS"
                }
              ],
              "data": [
                {
                  "timeStamp": "2023-02-01T20:00:00Z",
                  "average": 361,
                  "minimum": 361,
                  "maximum": 361
                },
                {
                  "timeStamp": "2023-02-01T20:15:00Z",
                  "average": 365.83088235294116,
                  "minimum": 361,
                  "maximum": 1018
                },
                {
                  "timeStamp": "2023-02-01T20:30:00Z",
                  "average": 361,
                  "minimum": 361,
                  "maximum": 361
                },
                {
                  "timeStamp": "2023-02-01T20:45:00Z",
                  "average": 363.4514925373134,
                  "minimum": 361,
                  "maximum": 1018
                },
                {
                  "timeStamp": "2023-02-01T21:00:00Z",
                  "average": 361,
                  "minimum": 361,
                  "maximum": 361
                },
                {
                  "timeStamp": "2023-02-01T21:15:00Z",
                  "average": 365.83088235294116,
                  "minimum": 361,
                  "maximum": 1018
                },
                {
                  "timeStamp": "2023-02-01T21:30:00Z",
                  "average": 361,
                  "minimum": 361,
                  "maximum": 361
                },
                {
                  "timeStamp": "2023-02-01T21:45:00Z",
                  "average": 363.4514925373134,
                  "minimum": 361,
                  "maximum": 1018
                },
                {
                  "timeStamp": "2023-02-01T22:00:00Z",
                  "average": 361,
                  "minimum": 361,
                  "maximum": 361
                },
                {
                  "timeStamp": "2023-02-01T22:15:00Z",
                  "average": 365.83088235294116,
                  "minimum": 361,
                  "maximum": 1018
                },
                {
                  "timeStamp": "2023-02-01T22:30:00Z",
                  "average": 361,
                  "minimum": 361,
                  "maximum": 361
                },
                {
                  "timeStamp": "2023-02-01T22:45:00Z",
                  "average": 363.4423791821561,
                  "minimum": 361,
                  "maximum": 1018
                }
              ]
            }
          ],
          "errorCode": "Success"
        }
      ],
      "namespace": "microsoft.storage/storageaccounts",
      "resourceregion": "eastus",
      "resourceid": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage1"
    },
    {
      "starttime": "2023-02-01T20:00:00.123Z",
      "endtime": "2023-02-01T23:00:00.345Z",
      "interval": "PT15M",
      "value": [
        {
          "id": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Ingress",
          "type": "Microsoft.Insights/metrics",
          "name": {
            "value": "Ingress",
            "localizedValue": "Ingress"
          },
          "displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.",
          "unit": "Bytes",
          "timeseries": [
            {
              "metadatavalues": [
                {
                  "name": {
                    "value": "apiname",
                    "localizedValue": "apiname"
                  },
                  "value": "GetBlobServiceProperties"
                },
                {
                  "name": {
                    "value": "authentication",
                    "localizedValue": "authentication"
                  },
                  "value": "AccountKey"
                }
              ],
              "data": [
                {
                  "timeStamp": "2023-02-01T20:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:00:00Z",
                  "average": 330,
                  "minimum": 330,
                  "maximum": 330
                },
                {
                  "timeStamp": "2023-02-01T22:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:45:00Z"
                }
              ]
            }
          ],
          "errorCode": "Success"
        },
        {
          "id": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2/providers/Microsoft.Insights/metrics/Egress",
          "type": "Microsoft.Insights/metrics",
          "name": {
            "value": "Egress",
            "localizedValue": "Egress"
          },
          "displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this number does not reflect billable egress.",
          "unit": "Bytes",
          "timeseries": [
            {
              "metadatavalues": [
                {
                  "name": {
                    "value": "apiname",
                    "localizedValue": "apiname"
                  },
                  "value": "GetBlobServiceProperties"
                },
                {
                  "name": {
                    "value": "authentication",
                    "localizedValue": "authentication"
                  },
                  "value": "AccountKey"
                }
              ],
              "data": [
                {
                  "timeStamp": "2023-02-01T20:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T20:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:00:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T21:45:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:00:00Z",
                  "average": 880,
                  "minimum": 880,
                  "maximum": 880
                },
                {
                  "timeStamp": "2023-02-01T22:15:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:30:00Z"
                },
                {
                  "timeStamp": "2023-02-01T22:45:00Z"
                }
              ]
            }
          ],
          "errorCode": "Success"
        }
      ],
      "namespace": "microsoft.storage/storageaccounts",
      "resourceregion": "eastus",
      "resourceid": "/subscriptions/12345678-abcd-1234-abcd-123456789abc/resourceGroups/TestGroup/providers/Microsoft.Storage/storageAccounts/TestStorage2"
    }
  ]
}
x-ms-error-code: BadRequest
{
  "error": {
    "additionalInfo": [
      {
        "type": "string",
        "info": "TraceId={00000000-0000-0000-0000-000000000000}"
      },
      {
        "type": "string",
        "info": "ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException"
      }
    ],
    "code": "BadRequest",
    "message": "Query endTime: 06/06/2021 00:00:00 is out of the Max metrics retention period: 93.00:00:00, traceId: {00000000-0000-0000-0000-000000000000}"
  }
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

LocalizableString

The localizable string class.

MetadataValue

Represents a metric metadata value.

Metric

The result data of a query.

MetricResultsResponse

The metrics result for a resource.

MetricUnit

The unit of the metric.

MetricValue

Represents a metric value.

ResourceIdList

The comma separated list of resource IDs to query metrics for.

TimeSeriesElement

A time series result type. The discriminator value is always TimeSeries in this case.

Values

The collection of metric data responses per resource, per metric.

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

LocalizableString

The localizable string class.

Name Type Description
localizedValue

string

The display name.

value

string

The invariant value.

MetadataValue

Represents a metric metadata value.

Name Type Description
name

LocalizableString

The name of the metadata.

value

string

The value of the metadata.

Metric

The result data of a query.

Name Type Description
displayDescription

string

Detailed description of this metric.

errorCode

string

'Success' or the error details on query failures for this metric.

errorMessage

string

Error message encountered querying this specific metric.

id

string

The metric Id.

name

LocalizableString

The name and the display name of the metric, i.e. it is localizable string.

timeseries

TimeSeriesElement[]

The time series returned when a data query is performed.

type

string

The resource type of the metric resource.

unit

MetricUnit

The unit of the metric.

MetricResultsResponse

The metrics result for a resource.

Name Type Description
values

Values[]

The collection of metric data responses per resource, per metric.

MetricUnit

The unit of the metric.

Name Type Description
BitsPerSecond

string

Rate unit of binary digits per second.

ByteSeconds

string

Unit of data transfer or storage. It is the size of the data in bytes multiplied by the time it takes to transfer or store the data in seconds.

Bytes

string

Unit of memory in bytes.

BytesPerSecond

string

Rate unit of memory in bytes per second.

Cores

string

Unit of processing power.

Count

string

Unit of raw quantity.

CountPerSecond

string

Rate unit of raw quantity per second.

MilliCores

string

Unit of processing power in 1/1000th of a CPU core.

MilliSeconds

string

Unit of time in 1/1000th of a second.

NanoCores

string

Unit of processing power in one billionth of a CPU core.

Percent

string

Percentage unit.

Seconds

string

Unit of time in seconds.

Unspecified

string

No specified unit.

MetricValue

Represents a metric value.

Name Type Description
average

number

The average value in the time range.

count

number

The number of samples in the time range. Can be used to determine the number of values that contributed to the average value.

maximum

number

The greatest value in the time range.

minimum

number

The least value in the time range.

timeStamp

string

The timestamp for the metric value in ISO 8601 format.

total

number

The sum of all of the values in the time range.

ResourceIdList

The comma separated list of resource IDs to query metrics for.

Name Type Description
resourceids

string[]

The list of resource IDs to query metrics for.

TimeSeriesElement

A time series result type. The discriminator value is always TimeSeries in this case.

Name Type Description
data

MetricValue[]

An array of data points representing the metric values. This is only returned if a result type of data is specified.

metadatavalues

MetadataValue[]

The metadata values returned if $filter was specified in the call.

Values

The collection of metric data responses per resource, per metric.

Name Type Description
endtime

string

The end time, in datetime format, for which the data was retrieved.

interval

string

The interval (window size) for which the metric data was returned in ISO 8601 duration format with a special case for 'FULL' value that returns single datapoint for entire time span requested (Examples: PT15M, PT1H, P1D, FULL). This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified.

namespace

string

The namespace of the metrics been queried

resourceid

string

The resource that has been queried for metrics.

resourceregion

string

The region of the resource been queried for metrics.

starttime

string

The start time, in datetime format, for which the data was retrieved.

value

Metric[]

The value of the collection.