Extend the platform,
empower your team.
Improve the health and performance monitoring of your Microsoft SQL Servers.
ExtensionMicrosoft SQL Server database monitoring is based on a remote monitoring approach implemented as a Dynatrace ActiveGate extension. The extension queries MS SQL databases for key performance and health metrics, extending your visibility, and allowing DAVIS AI to provide anomaly detection and problem analysis.
How does the extension affect the target database?
SELECT
queries to obtain monitoring data. The database is never modified or locked.sys.*
system views and msdb
database (when applicable). User databases and objects are never affected.How to size ActiveGates for this extension?
Are there any special considerations when monitoring Always On clusters?
What authentication schemas are supported?
Are self-signed SSL certificates and PKCS12 truststores supported?
v2.0.0
:
instance
dimension now only contains the name of the actual named instance or MSSQLSERVER
by default.hoursSinceBackup
metric is removed and replaced by sql-server.databases.backup.age
.v1.2.0
:
Top queries
How to enable?
Collection of top queries ordered by totla duration can be enabled using Queries
feature set.
How often is the information updated?
Top queries are fetched by extension every 5 minutes.
How to list top queries?
The query below, when executed in Logs and Events, displays top queries, as observed within the most recent 5 min timeframe, using DQL:
fetch logs, from:now()-5m
| filter matchesValue(extension, "sql_mssql")
| filter matchesValue(event.group, "longest_queries")
| fields total_duration, avg_duration, content, server, instance, num_executions, query_plan
| sort asDouble(total_duration) desc
total_duration
field represents a sum of all executions of this query over the given 5 min timeframe in secondsavg_duration
represents an average execution time of this query of the given 5 min timeframe in secondscontent
field contains the SQL text of the queryLargest files
How to enable?
Collection of largest database files by size can be enabled using Database files
feature set.
How often is the information updated?
Top database files by size are fetched by extension every 5 minutes.
How to list the largest database files by size?
The query below, when executed in Logs and Events, displays the largest database files, as observed within the most recent 5 min timeframe, by size using DQL:
fetch logs, from:now()-5m
| filter matchesValue(extension, "sql_mssql")
| filter matchesValue(event.group, "largest_files")
| fields content, file_size, file_type_desc, file_state_desc, database, server, instance, file_used_space, file_empty_space
| sort asDouble(file_size) desc
content
field represents the physical name of the file as handled by host OSfile_size
is reported in KBfile_used_space
is reported in KB and represents amount of space occupied by allocated pages within a specific filefile_empty_space
is reported in KB and represents amount of space that is still empty within a specifc fileCurrent jobs
How to enable?
Monitoring of current jobs can be enabled using Jobs
feature set.
How often is the information updated?
Current jobs are fetched by extension every 5 minutes.
How to list current jobs?
The query below, when executed in Logs and Events, displays current jobs, as observed within the most recent 5 min timeframe, using DQL:
fetch logs, from:now()-5m
| filter matchesValue(extension, "sql_mssql")
| filter matchesValue(event.group, "current_jobs")
| fields job_name, job_status, content, enabled, last_run_outcome, duration, instance, server, start_execution_date, stop_execution_date
| sort asDouble(duration) desc
content
field represents the last execution outcome message.job_status
and last_run_outcome
are identical, except for two situations:
job_status
equals Idle
job_status
equals In Progress
duration
represents complete job duration in seconds after execution is finishedFailed jobs
How to enable?
Monitoring of failed jobs can be enabled using Jobs
feature set.
How often is the information updated?
Failed jobs are fetched by extension every 5 minutes.
How to list failed jobs?
The query below, when executed in Logs and Events, displays failed jobs, as observed within the most recent 5 min timeframe, using DQL:
fetch logs, from:now()-5m
| filter matchesValue(extension, "sql_mssql")
| filter matchesValue(event.group, "failed_jobs")
| fields job_name, step_name, outcome, content, duration, instance, server, sql_severity, retries_attempted, start_execution_date, stop_execution_date
| sort stop_execution_date desc
content
field represents the message of the last executed step and usually contains the error.outcome
represents the final job status message as composed by SQL Server Agent.duration
represents complete job duration in seconds after execution is finishedEach available Feature Set is supported by a corresponding set of SQL Server types. For details on the individual permissions that must be granted to the extension user for each Feature Set, please refer to the Involved Views and Tables section and the granular permission details for each system view provided below.
default
Supported on:
Views and tables involved:
Memory
Supported on:
Involved Views and Tables:
Locks
Supported on:
Involved Views and Tables:
Latches
Supported on:
Involved Views and Tables:
Queries
Monitoring query performance stats
Supported on:
Involved Views and Tables:
Monitoring TOP longest queries:
Supported on:
Involved Views and Tables:
Replication
Supported on:
Involved Views and Tables:
Sessions
Supported on:
Involved Views and Tables:
Transaction logs
Supported on:
Involved Views and Tables:
Backups
Monitoring backup sets per database
Supported on:
Involved Views and Tables:
Monitoring backup files per database
Supported on:
Involved Views and Tables:
Database files
Monitoring database files stats
Supported on:
Involved Views and Tables:
Monitoring largest database files on Azure SQL Database
Supported on:
Involved Views and Tables:
Monitoring largest database files on other SQL Server types
Supported on:
Involved Views and Tables:
Always On
Supported on:
Involved Views and Tables:
Important:
To obtain information about every replica in a given availability group, connect the extension to the server instance that is hosting the primary replica. When connected to a server instance that is hosting a secondary replica of an availability group, the extension returns only local information for the availability group.
When connected to a secondary replica, the extension retrieves states of every secondary database on the server instance. On the primary replica, the extension returns data for each primary database and for the corresponding secondary database.
Depending on the action and higher-level states, database-state information may be unavailable or out of date. Furthermore, the values have only local relevance. See limitations of sys.dm_hadr_database_replica_states
.
Notes:
When a database is added to an availability group, the primary database is automatically joined to the group. Secondary databases must be manually prepared on each secondary replica before they can be joined to the availability group.
If the local server instance cannot communicate with the WSFC failover cluster, for example, because the cluster is down or quorum has been lost, only rows for local availability replicas are returned. These rows will contain only the columns of data that are cached locally in metadata.
Jobs
Supported on:
Involved Views and Tables
Required permissions
sys.dm_os_sys_info
VIEW SERVER PERFORMANCE STATE
permission.VIEW SERVER STATE
permission.##MS_ServerStateReader##
server role.VIEW DATABASE STATE
permission on the database; or##MS_ServerStateReader##
server role.VIEW SERVER STATE
permission.sys.dm_os_performance_counters
VIEW SERVER PERFORMANCE STATE
permission.VIEW SERVER STATE
permission.##MS_ServerStateReader##
server role.VIEW DATABASE STATE
permission on the database; or##MS_ServerStateReader##
server role.VIEW SERVER STATE
permission.sys.databases
master
database for all databases to be visible.master
database are visible.ONLINE
databases:
VIEW ANY DATABASE
(default permission for the public role)OFFLINE
databases as well:
ALTER ANY DATABASE
on server level; orCREATE DATABASE
permission in the master
database.sys.query_store_runtime_stats
VIEW DATABASE STATE
permission.sys.query_store_plan
VIEW DATABASE STATE
permission.sys.query_store_query
VIEW DATABASE STATE
permission.sys.query_store_query_text
VIEW DATABASE STATE
permission.sys.dm_exec_sessions
VIEW DATABASE STATE
permission.VIEW SERVER PERFORMANCE STATE
permission.VIEW SERVER STATE
permission.msdb.dbo.backupset
msdb.dbo.backupfile
sys.master_files
VIEW ANY DEFINITION
; orCREATE DATABASE
; orALTER ANY DATABASE
.sys.database_files
sys.availability_groups
VIEW ANY DEFINITION
permission.sys.availability_replicas
VIEW ANY DEFINITION
permission.sys.availability_databases_cluster
VIEW ANY DATABASE
; orALTER ANY DATABASE
; orCREATE DATABASE
permission in master
is required.sys.dm_hadr_availability_group_states
VIEW SERVER PERFORMANCE STATE
permission.VIEW SERVER STATE
permission.sys.dm_hadr_availability_replica_states
VIEW SERVER PERFORMANCE STATE
permission.VIEW SERVER STATE
permission.sys.dm_hadr_database_replica_states
VIEW SERVER PERFORMANCE STATE
permission.VIEW SERVER STATE
permission.Supported types of SQL Server:
Supported versions of SQL Server:
Any version of SQL Server with active extended support by Microsoft is supported by this extension. Please refer to the official Microsoft documentation about lifecycle dates for SQL Server.
Below is a complete list of the feature sets provided in this version. To ensure a good fit for your needs, individual metrics can be activated and deactivated by your administrator during configuration.
Metric name | Metric key | Description | Unit |
---|---|---|---|
CPU Count | sql-server.host.cpus | Detected CPU Count | Count |
Uptime | sql-server.uptime | Time in seconds since instance was last started | Seconds |
Physical memory | sql-server.memory.physical | Total amount of physical memory on the machine | KiloByte |
Virtual memory | sql-server.memory.virtual | Total amount of virtual address space available to the process in user mode | KiloByte |
Total server memory | sql-server.memory.total | Amount of memory the server has committed using the memory manager | KiloByte |
Target server memory | sql-server.memory.target | Amount of memory that can be consumed by memory manager | KiloByte |
Time spent in kernel mode | sql-server.cpu.kernelTime.count | Time spent by all threads in kernel mode | MilliSecond |
Time spent in user mode | sql-server.cpu.userTime.count | Time spent by all threads in user mode | MilliSecond |
Logins | sql-server.general.logins.count | Number of logins started, excluding pooled connections | Count |
User connections | sql-server.general.userConnections | Number of users currently connected to SQL Server | Count |
Processes blocked | sql-server.general.processesBlocked | Number of currently blocked processes | Count |
Database state | sql-server.databases.state | Database state | State |
Transactions | sql-server.databases.transactions.count | Number of transactions started for the database | Count |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Minutes since last backup | sql-server.databases.backup.age | Number of minutes passed since last backup | Minute |
Size of the last backup | sql-server.databases.backup.size | Size of the last backup of that type | Byte |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Batch requests | sql-server.sql.batchRequests.count | Number of Transact-SQL command batches received | Count |
SQL compilations | sql-server.sql.compilations.count | Number of SQL statement compilations | Count |
SQL re-compilations | sql-server.sql.recompilations.count | Number of SQL statement re-compilations | Count |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Log files size | sql-server.databases.log.filesSize | Cumulative size of all the transaction log files in the database | KiloByte |
Log files used size | sql-server.databases.log.filesUsedSize | The cumulative used size of all the log files in the database | KiloByte |
Log flush waits | sql-server.databases.log.flushWaits.count | Number of commits waiting for the log flush | Count |
Log growths | sql-server.databases.log.growths.count | Number of times the transaction log for the database has been expanded | Count |
Log shrinks | sql-server.databases.log.shrinks.count | Number of log shrinks for this database | Count |
Log truncations | sql-server.databases.log.truncations.count | Number of times the transaction log has been truncated (in Simple Recovery Model) | Count |
Percent log used | sql-server.databases.log.percentUsed | Percantage of space in the log that is in use | Percent |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Latch waits | sql-server.latches.waits.count | Number of latch requests that could not be granted immediately | Count |
Average latch wait time | sql-server.latches.averageWaitTime.count | Average latch wait time for latch requests that had to wait | MilliSecond |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Database file size | sql-server.databases.file.size | Total size of files of specific types per database | KiloByte |
Database file used size | sql-server.databases.file.usedSpace | Total size of space used in files of specific types per database | KiloByte |
Database file empty size | sql-server.databases.file.emptySpace | Total size of empty space in files of specific types per database | KiloByte |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Free list stalls | sql-server.buffers.freeListStalls.count | Number of requests that had to wait for a free page | Count |
Page reads | sql-server.buffers.pageReads.count | Number of physical database page reads that are issued | Count |
Page writes | sql-server.buffers.pageWrites.count | Number of physical database page writes that are issued | Count |
Checkpoint pages | sql-server.buffers.checkpointPages.count | Number of pages flushed to disk by a checkpoint or other operations that require all dirty pages to be flushed | Count |
Page life expectancy | sql-server.buffers.pageLifeExpectancy | Number of seconds a page will stay in the buffer pool without references | Second |
Connection memory | sql-server.memory.connection | Total amount of dynamic memory the server is using for maintaining connections | KiloByte |
Memory grants outstanding | sql-server.memory.grantsOutstanding | Number of processes that have successfully acquired a workspace memory grant | Count |
Memory grants pending | sql-server.memory.grantsPending | Number of processes waiting for a workspace memory grant | Count |
Buffer cache hit | sql-server.buffers.cacheHitRatio | Percentage of pages found in the buffer cache without having to read from disk | Percent |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Uptime | sql-server.sessions | Number of active sessions per user | Count |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Lock timeouts | sql-server.locks.timeouts.count | Number of lock requests that timed out, including requests for NOWAIT locks | Count |
Deadlocks | sql-server.locks.deadlocks.count | Number of lock requests that resulted in a deadlock | Count |
Lock waits | sql-server.locks.waits.count | Number of lock requests that required the caller to wait | Count |
Lock wait time | sql-server.locks.waitTime.count | Wait time for locks | MilliSecond |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Bytes sent to replica | sql-server.replica.bytesSent.count | Message bytes queued to be sent to replicas | Byte |
Sends to replica | sql-server.replica.sends.count | Number of messages queued to be sent to replica | Count |
Bytes sent to transport | sql-server.replica.bytesSentToTransport.count | Dequeued message bytes sent across network to replicas | Byte |
Sends to transport | sql-server.replica.sendsToTransport.count | Number of messages sent across network to replicas | Count |
Bytes received from replica | sql-server.replica.bytesReceived.count | Message bytes received from replica | Byte |
Receives from replica | sql-server.replica.receives.count | Number of messages received from replica | Count |
Resent messages | sql-server.replica.resentMessages.count | Number of messages that had to be resent to replica | Count |
Metric name | Metric key | Description | Unit |
---|---|---|---|
Automated backup preference | sql-server.always-on.ag.automatedBackupPreference | Preferred location for backups in this availability group | State |
Primary recovery health | sql-server.always-on.ag.primaryRecoveryHealth | Indicates the recovery health of the primary replica | State |
Secondary recovery health | sql-server.always-on.ag.secondaryRecoveryHealth | Indicates the recovery health of a secondary replica | State |
Synchronization health | sql-server.always-on.ag.synchronizationHealth | Reflects a rollup of the synchronization health of all replicas the group | State |
Availability mode | sql-server.always-on.ar.availabilityMode | The availability mode of the replica | State |
Failover mode | sql-server.always-on.ar.failoverMode | The failover mode of the replica | State |
Is replica local | sql-server.always-on.ar.isLocal | Whether the replica is local | State |
Replica role | sql-server.always-on.ar.role | Current groups role of a local replica or a connected remote replica | State |
Operational state | sql-server.always-on.ar.operationalState | Current operational state of the replica | State |
Recovery health | sql-server.always-on.ar.recoveryHealth | Rollup of the database_state column | State |
Synchronization health | sql-server.always-on.ar.synchronizationHealth | Rollup of the database synchronization state of all joined replicas and the availability mode of the replica | State |
Connected state | sql-server.always-on.ar.connectedState | Whether a secondary replica is currently connected to the primary replica | State |
Synchronization state | sql-server.always-on.db.synchronizationState | Data-movement state | State |
Synchronization health | sql-server.always-on.db.synchronizationHealth | Intersection of the synchronization state of a database that is joined to the group on the replica and the availability mode of the replica | State |
Database state | sql-server.always-on.db.state | State of the availability database | State |
Log send queue size | sql-server.always-on.db.logSendQueueSize | Amount of log records of the primary database not sent to the secondary databases | KibiByte |
Log send rate | sql-server.always-on.db.logSendRate | Average rate at which primary replica instance sends data | KiloBytePerSecond |
Redo queue size | sql-server.always-on.db.redoQueueSize | Amount of log records in the log files of the secondary replica that has not yet been redone | KiloByte |
Redo rate | sql-server.always-on.db.redoRate | Average Rate at which the log records are being redone on a given secondary database | KiloBytePerSecond |
Filestream send rate | sql-server.always-on.db.filestreamSendRate | The rate at which the filestream files are shipped to the secondary replica | KiloBytePerSecond |
Improvements:
New features:
Jobs
feature set).Addressed issues:
backup_type
dimension now contains full backup type names instead of a single letter.instance
dimension changes its meaning to only contains an actual named instance name or MSSQLSERVER
by default.hoursSinceBackup
metric is removed and replaced by sql-server.databases.backup.age
.instance
dimension is now retrieved from "InstanceName" server property but only contains an actual named instance name. Defaults to MSSQLSERVER
for unnamed instances.server
dimension is now retrieved from ServerName
but only contains an actual machine or server name, without named instance.instance
and server
dimensions.SQL Server extension starting with version 1.2+ introduces feature sets. The feature sets need to be enabled for each updated monitoring configuration. Otherwise data collection for monitored endpoints stops after updating configuration.
Improvements:
Bugfixes: