Databases - List Metric Definitions

Returns database metric definitions.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions?api-version=2014-04-01

URI Parameters

Name In Required Type Description
databaseName
path True

string

The name of the database.

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Responses

Name Type Description
200 OK

MetricDefinitionListResult

OK

Examples

List database usage metrics

Sample request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6730/providers/Microsoft.Sql/servers/sqlcrudtest-9007/databases/3481/metricDefinitions?api-version=2014-04-01

Sample response

{
  "value": [
    {
      "name": {
        "value": "cpu_percent",
        "localizedValue": "CPU percentage"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT15S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT60S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "physical_data_read_percent",
        "localizedValue": "Data IO percentage"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT15S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT60S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "log_write_percent",
        "localizedValue": "Log IO percentage"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT15S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT60S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "dtu_consumption_percent",
        "localizedValue": "DTU percentage"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT15S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT60S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "storage",
        "localizedValue": "Total database size"
      },
      "unit": "Bytes",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Maximum",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "xtp_storage_percent",
        "localizedValue": "In-Memory OLTP storage percent"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT15S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT60S",
          "retention": "PT1H"
        },
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "workers_percent",
        "localizedValue": "Workers percentage"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "sessions_percent",
        "localizedValue": "Sessions percentage"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "dtu_limit",
        "localizedValue": "DTU limit"
      },
      "unit": "Count",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "dtu_used",
        "localizedValue": "DTU used"
      },
      "unit": "Count",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Average",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "connection_successful",
        "localizedValue": "Successful Connections"
      },
      "unit": "Count",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Total",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "connection_failed",
        "localizedValue": "Failed Connections"
      },
      "unit": "Count",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Total",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "blocked_by_firewall",
        "localizedValue": "Blocked by Firewall"
      },
      "unit": "Count",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Total",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "deadlock",
        "localizedValue": "Deadlocks"
      },
      "unit": "Count",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Total",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    },
    {
      "name": {
        "value": "storage_percent",
        "localizedValue": "Database size percentage"
      },
      "unit": "Percent",
      "resourceUri": "/subscriptions/b6a6e0c5-e79c-4c6d-a878-72eafbca4cf2/resourceGroups/QA/providers/Microsoft.Sql/servers/nafantest/databases/db1",
      "primaryAggregationType": "Maximum",
      "metricAvailabilities": [
        {
          "timeGrain": "PT5M",
          "retention": "P14D"
        },
        {
          "timeGrain": "PT1H",
          "retention": "P14D"
        },
        {
          "timeGrain": "P1D",
          "retention": "P14D"
        }
      ]
    }
  ]
}

Definitions

Name Description
MetricAvailability

A metric availability value.

MetricDefinition

A database metric definition.

MetricDefinitionListResult

The response to a list database metric definitions request.

MetricName

A database metric name.

PrimaryAggregationType

The primary aggregation type defining how metric values are displayed.

UnitDefinitionType

The unit of the metric.

MetricAvailability

A metric availability value.

Name Type Description
retention

string

The length of retention for the database metric.

timeGrain

string

The granularity of the database metric.

MetricDefinition

A database metric definition.

Name Type Description
metricAvailabilities

MetricAvailability[]

The list of database metric availabilities for the metric.

name

MetricName

The name information for the metric.

primaryAggregationType

PrimaryAggregationType

The primary aggregation type defining how metric values are displayed.

resourceUri

string

The resource uri of the database.

unit

UnitDefinitionType

The unit of the metric.

MetricDefinitionListResult

The response to a list database metric definitions request.

Name Type Description
value

MetricDefinition[]

The list of metric definitions for the database.

MetricName

A database metric name.

Name Type Description
localizedValue

string

The friendly name of the database metric.

value

string

The name of the database metric.

PrimaryAggregationType

The primary aggregation type defining how metric values are displayed.

Name Type Description
Average

string

Count

string

Maximum

string

Minimum

string

None

string

Total

string

UnitDefinitionType

The unit of the metric.

Name Type Description
Bytes

string

BytesPerSecond

string

Count

string

CountPerSecond

string

Percent

string

Seconds

string