Our Microsoft SQL Server integration collects and sends inventory and metrics from your MS SQL Server environment to our platform, where you can see the health of your MS SQL Server environment. We collect both database and instance-level metrics so that you can pinpoint the source of any problems.
Read on to install the integration, and to see what data we collect.
Our integration is compatible with Microsoft SQL Server 2008 R2 SP3 or higher.
Before installing the integration, make sure that you meet the following requirements:
- Install the infrastructure agent.
- Windows distribution compatible with the infrastructure agent.
- Microsoft SQL Server user with user privileges for both
VIEW SERVER STATE, and
Instrument your MS SQL Server environment quickly and send your telemetry data with guided install. Our guided install creates a customized CLI command for your environment that downloads and installs the New Relic CLI and the infrastructure agent.
Ready to get started? Click one of these button to try it out.
Our guided install uses the infrastructure agent to set up the Microsoft SQL Server integration. Not only that, it discovers other applications and log sources running in your environment and then recommends which ones you should instrument.
The guided install works with most setups. But if it doesn't suit your needs, you can find other methods below to get started monitoring your MS SQL Server environment.
In the Microsoft SQL Server that is to be monitored, execute the following script to create a new user and grant
VIEW SERVER STATE, and read access permissions to that user.
Use the following statements to create a new login and to grant
VIEW SERVER STATEpermissions to the login.
USE master; CREATE LOGIN newrelic WITH PASSWORD = 'tmp_password'; --insert new password here GRANT CONNECT SQL TO newrelic; GRANT VIEW SERVER STATE TO newrelic; GRANT VIEW ANY DEFINITION TO newrelic;
Use the following statements to grant read access privileges to the user.DECLARE @name SYSNAMEDECLARE db_cursor CURSORREAD_ONLY FORWARD_ONLYFORSELECT NAMEFROM master.sys.databasesWHERE NAME NOT IN ('master','msdb','tempdb','model','rdsadmin','distribution')OPEN db_cursorFETCH NEXT FROM db_cursor INTO @name WHILE @@FETCH_STATUS = 0BEGINEXECUTE('USE "' + @name + '"; CREATE USER newrelic FOR LOGIN newrelic;' );FETCH next FROM db_cursor INTO @nameENDCLOSE db_cursorDEALLOCATE db_cursor
Run the following command to verify that the user was successfully created.
sqlcmd -U user_name -S host_name
To install the Microsoft SQL Server integration:
Download the latest .MSI installer image from:
In an admin account, run the install script using an absolute path.
C:\Program Files\New Relic\newrelic-infra\integrations.d\mssql-config.yml.sampleto
mssql-config.yml, and edit according to your instance.
- On-host integrations do not automatically update. For best results, regularly update the integration package and the infrastructure agent.
An integration's YAML-format configuration is where you can place required login credentials and configure how data is collected. Which options you change depend on your setup and preference.
For an example configuration, see the example config file.
With secrets management, you can configure on-host integrations with New Relic Infrastructure's agent to use sensitive data (such as passwords) without having to write them as plain text into the integration's configuration file. For more information, see Secrets management.
mssql-config.yml file accepts the following commands:
all_data: collects both inventory and metric data from the Microsoft SQL Server environment.
all_data command accepts the following arguments:
username: username used to authenticate the MS SQL Server. To use Windows Authentication, specify this argument in the
DOMAIN\usernameform. This field is required.
password: password used to authenticate the MS SQL Server. This field is required.
hostname: hostname or IP of the MS SQL Server installation. Default:
port: port number on which the MS SQL Server is listening. This is only required when
instanceis not specified.
instance: instance the Microsoft SQL Server is connected to.
instancecan be used in place of
SQL Browser; if enabled, do not include
portin the argument.
enable_ssl: indicates whether SSL is used to connect to the MS SQL Server. Default:
trust_server_certificate: if set to
true, server certificate is not verified for SSL. If set to
false, certificate will be verified against supplied certificate.
certificate_location: certificate file to verify SSL encryption against.
timeout: timeout for queries, in seconds. Default:
enable_buffer_metrics: enables the collection of buffer pool metrics. These can be resource intensive for large systems. Default:
enable_database_reserve_metrics: enables the collection of database partition reserve space. These can be resource intensive for large systems. Default:
custom_metrics_query: an SQL query with the required columns
attribute. Additional columns collected with the query are added to the metric set as attributes. Custom queries metrics will be attached to the
custom_metrics_config: full path and file name for an external queries YAML file. Use this instead of
custom_metrics_queryif you need execute multiple custom queries. For an example configuration, see the example config file.
extra_connection_url_args: appends additional parameters to connection URL. Ex. 'applicationintent=readonly&foo=bar'
If both port and instance are omitted, the default port of 1433 is used.
mssql-config.yml file configuration:
For more about the general structure of on-host integration configuration, see Configuration.
To find your integration data go to one.newrelic.com > Infrastructure > Third-party services and select one of the Microsoft SQL Server integration links.
Microsoft SQL Server data is attached to the following event types:
MssqlCustomQuerySample(if you running custom queries)
For more on how to find and use your data, see Understand integration data.
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
These attributes can be found by querying the
The size of the buffer pool per database.
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.
Total page file size, in bytes.
The Microsoft SQL Server integration collects the following instance metrics. These attributes can be found by querying the
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.
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.
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.
The total physical memory, in bytes.
The percentage of memory utilization.
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 MS SQL Server is unable to retain a lock right away for a resource.
The number of MS SQL compilations per second.
The number of MS SQL 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
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.
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
This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it.