Skip to main content

databases_metrics

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

Overview

Namedatabases_metrics
TypeResource
Idazure.sql.databases_metrics

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
nameobjectThe name information for the metric.
endTimestring (date-time)The end time for the metric (ISO-8601 format).
metricValuesarrayThe metric values for the specified time window and timestep.
startTimestring (date-time)The start time for the metric (ISO-8601 format).
timeGrainstringThe time step to be used to summarize the metric values.
unitstringThe unit of the metric.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectsubscriptionId, resourceGroupName, serverName, databaseName, $filterReturns database metrics.

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
$filterstringAn OData filter expression that describes a subset of metrics to return.
databaseNamestringThe name of the database.
resourceGroupNamestringThe name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
serverNamestringThe name of the server.
subscriptionIdstringThe subscription ID that identifies an Azure subscription.

SELECT examples

Returns database metrics.

SELECT
name,
endTime,
metricValues,
startTime,
timeGrain,
unit
FROM azure.sql.databases_metrics
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND serverName = '{{ serverName }}' -- required
AND databaseName = '{{ databaseName }}' -- required
AND $filter = '{{ $filter }}' -- required
;