Fix sql_instance tag with sqlserver managed instance (#6116)

This commit is contained in:
denzilribeiro 2019-07-15 13:46:52 -05:00 committed by Daniel Nelson
parent 3f424b88c9
commit 329179c0ff
1 changed files with 19 additions and 22 deletions

View File

@ -1300,7 +1300,7 @@ const sqlAzureDBResourceGovernance string = `
IF SERVERPROPERTY('EngineEdition') = 5 -- Is this Azure SQL DB? IF SERVERPROPERTY('EngineEdition') = 5 -- Is this Azure SQL DB?
SELECT SELECT
'sqlserver_db_resource_governance' AS [measurement], 'sqlserver_db_resource_governance' AS [measurement],
server_name AS [sql_instance], @@servername AS [sql_instance],
DB_NAME() as [database_name], DB_NAME() as [database_name],
slo_name, slo_name,
dtu_limit, dtu_limit,
@ -1335,25 +1335,22 @@ SELECT
FROM FROM
sys.dm_user_db_resource_governance WITH (NOLOCK); sys.dm_user_db_resource_governance WITH (NOLOCK);
ELSE ELSE
IF SERVERPROPERTY('EngineEdition') = 8 -- Is this Azure SQL Managed Instance?
BEGIN BEGIN
IF SERVERPROPERTY('EngineEdition') = 8 -- Is this Azure SQL Managed Instance?
SELECT SELECT
'sqlserver_instance_resource_governance' AS [measurement], 'sqlserver_instance_resource_governance' AS [measurement],
server_name AS [sql_instance], @@SERVERNAME AS [sql_instance],
instance_cap_cpu, instance_cap_cpu,
instance_max_log_rate, instance_max_log_rate,
instance_max_worker_threads, instance_max_worker_threads,
tempdb_log_file_number,
volume_local_iops, volume_local_iops,
volume_external_xstore_iops, volume_external_xstore_iops,
volume_managed_xstore_iops, volume_managed_xstore_iops,
volume_type_local_iops, volume_type_local_iops as voltype_local_iops,
volume_type_managed_xstore_iops, volume_type_managed_xstore_iops as voltype_man_xtore_iops,
volume_type_external_xstore_iops, volume_type_external_xstore_iops as voltype_ext_xtore_iops,
volume_external_xstore_iops, volume_external_xstore_iops as vol_ext_xtore_iops
volume_local_max_oustanding_io,
volume_managed_xstore_max_oustanding_io,
volume_external_xstore_max_oustanding_io,
tempdb_log_file_number
from from
sys.dm_instance_resource_governance sys.dm_instance_resource_governance
END; END;