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 so you can 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.
Choose your environment
Choose your install path
Choose how you'll enable your SQL server
Check the compatibility and requirements
To enable the integration, ensure you meet these requirements:
- Microsoft SQL Server 2014 to Microsoft SQL Server 2022
- TLS authentication version TLS 1.2 and above
- SQL Server user, domain user, or gMSA with user privileges for both
CONNECT
andVIEW SERVER STATE
, andREAD
access permissions
tip
You can enable query-level monitoring for Windows environment. For more information, refer Enable query-level monitoring for Microsoft SQL Server.
Install the infrastructure agent
To use the Microsoft SQL Server integration, you need to first install the infrastructure agent on a Linux or Windows host, or on a host capable of remotely accessing Microsoft SQL Server. The infrastructure agent monitors the host itself, while the integration you'll install in the next step extends your monitoring with Microsoft SQL Server-specific data.
重要
If using a gMSA for SQL Server access, then the infrastructure agent needs to run as the gMSA.
Download using MSI
Download the latest .MSI installer image for the desired integration from our repository.
In your terminal, run this command.
bash$msiexec.exe /qn /i PATH\TO\nri-mssql-amd64.msi
Enable your Microsoft SQL Server
Create a new login and grant
CONNECT
andVIEW
permissions:USE master;CREATE LOGIN [DomainName\gMSA] FROM windows;GRANT CONNECT SQL TO [Domain\gMSA];GRANT VIEW SERVER STATE TO [Domain\gMSA];GRANT VIEW ANY DEFINITION TO [Domain\gMSA];Use the following statements to grant
READ
access privileges to the user:
DECLARE @name SYSNAME DECLARE db_cursor CURSOR READ_ONLY FORWARD_ONLY FOR SELECT NAME FROM master.sys.databases WHERE NAME NOT IN ('master','msdb','tempdb','model','rdsadmin','distribution') OPEN db_cursor FETCH NEXT FROM db_cursor INTO @name WHILE @@FETCH_STATUS = 0 BEGIN EXECUTE('USE "' + @name + '"; CREATE USER [Domain\gMSA] FOR LOGIN [Domain\gMSA];' ); FETCH next FROM db_cursor INTO @name END CLOSE db_cursor DEALLOCATE db_cursor
Find and use data
Follow these steps:
- Go to one.newrelic.com > Integrations & Agents and type MSSQL On-Host Integration.
- Under Dashboards, click MSSQL On-Host Integration w/ Custom Queries.
- A popup window opens.
- Click Edit to change the account.
- Click View dashboard to see your Microsoft SQL server data in New Relic.
For more on how to find and use your data, see how to understand integration data. You can find a full list of metrics and their attributes at the bottom of this doc.
Microsoft SQL Server data is attached to the following event types:
MssqlDatabaseSample
MssqlInstanceSample
MssqlWaitSample
MssqlCustomQuerySample
, if you run custom queries.
Sample configuration files
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.
.
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 MS SQL server is running. |
| M/I |
| Port on which MS SQL server is listening.
|
| M/I |
| The MS SQL Server Instance to connect to.
| N/A | M/I |
| Username for accessing the MS 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 MS 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.重要
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.
Inventory data
The Microsoft SQL Server integration captures the configuration parameters and current settings of the Microsoft 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.