This metric reports the total space used by database files in GB. This includes data files but excludes log files.
This lets you track the growth of the databases over time so you can be aware of future space requirements.
Alternatively, the following T-SQL can be used for SQL Server 2012 and higher:
SELECT CAST(SUM(allocated_extent_page_count * 8.0 / 1024. / 1024.) AS DECIMAL(18,6)) AS Allocated_GB
Space used by Database objects in GB
Monitors the total space used by data files in the database. This excludes log files.
The T-SQL query that will collect data
Instances to collect from
The instance that contains the database you're interested in.
Databases to collect from
The database you're interested in.
Use collected or calculated values
Leave the Use a calculated rate of change between collections check box unchecked
An alert is not required