Microsoft SQL monitoring integration
Our Microsoft SQL Server integration collects and sends metric and inventory data from your Microsoft SQL Server environment to our platform to equip you to monitor the health of your Microsoft SQL Server environment. We collect both database and instance-level metrics so you can troubleshoot and resolve performance problems.

Dashboard installed through the New Relic Microsoft SQL Server monitoring integration.
Metrics collected by the integration
The Microsoft SQL Server integration collects the following metric data attributes. Some metric name are prefixed with a category indicator and a period, such as asserts.
or flush.
.
These attributes can be found by querying the MssqlDatabaseSample
event.
Metric | Description |
---|---|
| The size of the buffer pool per database. It is reported when |
| Maximum database size in bytes. It is reported when |
| Wait time of stall since last restart, in milliseconds. |
| Total number of times the transaction log for the database has been expanded since the last restart. |
| Available page file size, in bytes. It is reported when |
| Total page file size, in bytes. It is reported when |
| The available physical memory, in bytes. Applies to: Azure SQL Database. |
| The total physical memory, in bytes. Applies to: Azure SQL Database. |
| The percentage of memory utilization. Applies to: Azure SQL Database. |
The Microsoft SQL Server integration collects the following instance metrics. These attributes can be found by querying the MssqlInstanceSample
event.
Metric | Description |
---|---|
| The number of page splits per second. |
| The number of active connections. |
| The number of pages flushed to disk per second by a checkpoint or other operation that require all dirty pages to be flushed. |
| The number of batch requests per second on the buffer pool. |
| The life expectancy of a page in the buffer pool, in milliseconds. |
| The size of the buffer pool, in bytes. It is reported when |
| The number of background processes on the instance. |
| The number of blocked processes on the instance. |
| The amount of disk space on the instance, in bytes. It is reported
when |
| The number of dormant processes on the instance. |
| The number of forced parameterizations per second on the instance. |
| The number of preconnect processes on the instance. |
| The number of runnable processes on the instance. |
| The number of runnable tasks on the instance. |
| The number of running processes on the instance. |
| The number of sleeping processes on the instance. |
| The number of suspended processes on the instance. |
| The number of transactions per second on the instance. |
| The available physical memory, in bytes. This metric is not reported in case of Azure SQL Database. |
| The total physical memory, in bytes. This metric is not reported in case of Azure SQL Database. |
| The percentage of memory utilization. This metric is not reported in case of Azure SQL Database. |
| The number of user connections. |
| The number of lock requests per second that resulted in a deadlock since the last restart. |
| The number of kill connection errors per second since the last restart. |
| The number of times per second that Microsoft SQL Server is unable to retain a lock right away for a resource. |
| The number of Microsoft SQL Server compilations per second. |
| The number of Microsoft SQL Server re-compilations per second. |
| The number of user errors per second since the last restart. |
| The percentage of buffer pools hits on the instance. |
| The number of milliseconds per second spent waiting across the instance. |
These attributes can be found by querying the MssqlWaitSample
event.
Metric | Description |
---|---|
| Total wait time for this wait type, in milliseconds. This time is inclusive of |
| The number of waits on this wait type, in milliseconds. This counter is incremented at the start of each wait. |
Microsoft SQL Server instance settings
The Microsoft SQL Server integration collects both metrics and inventory information. In the table, use the Applies to column for the settings available to each collection:
Setting | Description | Default | Applies to |
---|---|---|---|
| Hostname or IP where Microsoft SQL Server is running. |
| M/I |
| Port on which Microsoft SQL Server is listening.
|
| M/I |
| The Microsoft SQL Server instance to connect to.
| N/A | M/I |
| Username for accessing the Microsoft SQL Server.
| N/A | M/I |
| Password for the given SQL or Domain user. | N/A | M/I |
| Specify extra connection parameters as attr1=val1&attr2=val2. | N/A | M/I |
| Use SSL to connect to the Microsoft SQL Server. |
| M/I |
| if set to |
| M/I |
| Location of the SSL Certificate. | N/A | M/I |
| Timeout for queries, in seconds. Set |
| M/I |
| Enable collection of buffer pool metrics. These can be resource intensive for large systems. |
| M |
| Enable collection of database partition reserve space. These can be resource intensive for large systems. |
| M |
| Enable collection of the volume stats for each MSSQL instance. |
| M |
| A SQL query to collect custom metrics. See the custom query example. | N/A | M |
| YAML configuration with one or more SQL queries to collect custom metrics. See the multiple custom queries example. |
| M |
| Set to |
| |
| Set to |
|
The values for these settings can be defined in several ways:
Adding the value directly in the config file. This is the most common way.
Replacing the values from environment variables using the
{{ }}
notation. Read more about using environment variable passthroughs with on-host integrations or see the example for environment variables replacement.Important
This requires infrastructure agent v1.14.0+.Using secrets management. Use this to protect sensitive information, such as passwords that would be exposed in plain text on the configuration file. For more information, see secrets management.
Metrics collected by query performance monitoring
These attributes can be found by querying the MSSQLBlockingSessionQueries
event.
Metric | Description |
---|---|
blocking_spid | The ID of the blocking session. |
blocking_status | The status of the blocking session. |
blocked_spid | The ID of the blocked session. |
blocked_status | The status of the blocked session. |
wait_type | The type of wait experienced by the blocked session. |
wait_time_in_seconds | The time the session has been waiting in seconds. |
command_type | The type of command being performed. |
database_name | The name of the database where the blocking is occurring. |
blocking_query_text | The text of the query causing the block. |
blocked_query_text | The text of the query being blocked. |
blocked_query_start_time | The start time of the blocked query. |
These attributes can be found by querying the MSSQLQueryExecutionPlans
event.
Metric | Description |
---|---|
| The SQL statement text. |
| The unique identifier for the query. |
| The unique identifier for the query plan. |
| The ID of the node in the execution plan. |
| The physical operation performed by this node. |
| The logical operation represented by this node. |
| The estimated number of rows this operation will produce. |
| The estimated I/O cost of this operation. |
| The estimated CPU cost of this operation. |
| The average size of the rows processed by this node. |
| The estimated total cost for running this subtree. |
| The cost estimate of the node's operation. |
| The estimated execution mode of this operation. |
| The amount of memory granted for this query in kilobytes. |
| A boolean indicator of whether a spill occurred. |
| A boolean indicator of whether there is a join predicate. |
| The total worker time in milliseconds. |
| The total elapsed time in milliseconds. |
| The total number of logical reads performed. |
| The total number of logical writes performed. |
| The number of times the query was executed. |
| The plan handle used for retrieving the plan. |
| The average elapsed time in milliseconds. |
These attributes can be found by querying the MSSQLWaitTimeAnalysis
event.
Metric | Description |
---|---|
| The unique identifier for the query. |
| The name of the database. |
| The text of the query. |
| The category of wait experienced by the query. |
| The total amount of wait time in milliseconds. |
| The average amount of wait time in milliseconds. |
| The count of wait events that occurred. |
| The time of the last execution of the query. |
| The timestamp of when the data was collected. |
These attributes can be found by querying the MSSQLTopSlowQueries
event.
Metrics | Description |
---|---|
| The unique identifier for the query. |
| The text of the query. |
| The name of the database. |
| The name of the schema. |
| The timestamp of the last execution of the query. |
| The number of times the query was executed. |
| The average CPU time in milliseconds. |
| The average elapsed time in milliseconds. |
| The average number of disk reads. |
| The average number of disk writes. |
| The type of SQL statement. |
| The timestamp of when the data was collected. |
Inventory data
The Microsoft SQL Server integration captures the configuration parameters and current settings from your SQL Server environment. It collects the results of the sp_configure
stored procedure, as well as current running configuration settings from the sys.configurations
table. The data is available on the Inventory page, under the config/mssql
source.
For more about inventory data, see Understand integration data.