Preview
We're still working on this feature, but we'd love for you to try it out!
This feature is currently provided as part of a preview pursuant to our pre-release policies.
Set up Microsoft SQL Server monitoring using the NRDOT collector on Windows environments to monitor AWS RDS for SQL Server instances.
Based on your RDS SQL Server security configuration, you can choose from three authentication methods to connect the NRDOT Collector to your RDS instance:
Prerequisites
Ensure your environment meets our compatibility and prerequisites.
Setup the NRDOT Collector
Install the NRDOT Collector on an EC2 Windows instance or a local Windows machine that can connect to your RDS SQL Server instance.
Importante
For RDS monitoring, install the NRDOT Collector on an EC2 instance in the same VPC as your RDS instance for optimal network connectivity and lower latency.
Download and install the NRDOT Collector using PowerShell:
[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls'; $NRDOT_VERSION = (Invoke-RestMethod -Uri "https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest").tag_name; $WebClient = New-Object System.Net.WebClient; $WebClient.Headers.Add("User-Agent", "Mozilla/5.0"); $WebClient.DownloadFile("https://github.com/newrelic/nrdot-collector-releases/releases/download/$NRDOT_VERSION/nrdot-collector_${NRDOT_VERSION}_windows_x64.msi", "$env:TEMP\nrdot-collector.msi"); Start-Process msiexec.exe -ArgumentList "/i `"$env:TEMP\nrdot-collector.msi`" /qn /norestart /L*V `"$env:TEMP\nrdot_install.log`"" -Wait; Get-Service nrdot-collector -ErrorAction SilentlyContinueEnsure your security group allows inbound connections from the NRDOT Collector host to your RDS instance on port 1433 (or your custom port).
Configure database user
Connect to your RDS SQL Server instance using SQL Server Management Studio (SSMS) or sqlcmd with your admin credentials.
Run the following script to create the newrelic monitoring user with appropriate permissions:
USE [master];GOCREATE LOGIN [newrelic] WITH PASSWORD = '<PASSWORD>';GO
GRANT VIEW SERVER STATE TO [newrelic];GRANT VIEW ANY DEFINITION TO [newrelic];GRANT VIEW ANY DATABASE TO [newrelic];GO
DECLARE @name SYSNAME;DECLARE db_cursor CURSOR READ_ONLY FORWARD_ONLY FORSELECT [name]FROM [master].[sys].[databases]WHERE [name] NOT IN ('master', 'msdb', 'model', 'rdsadmin', 'distribution')AND [state] = 0;OPEN db_cursor;FETCH NEXT FROM db_cursor INTO @name;WHILE @@FETCH_STATUS = 0BEGIN BEGIN TRY EXEC('USE [' + @name + ']; IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = ''newrelic'') BEGIN CREATE USER [newrelic] FOR LOGIN [newrelic]; END; GRANT VIEW DATABASE STATE TO [newrelic];'); END TRY BEGIN CATCH PRINT 'Error on ' + @name + ': ' + ERROR_MESSAGE(); END CATCH FETCH NEXT FROM db_cursor INTO @name;ENDCLOSE db_cursor;DEALLOCATE db_cursor;GOSugerencia
For RDS: Use your RDS master username (or a user with rds_superuser role) to execute these commands. The script automatically excludes the rdsadmin database which is reserved by AWS.
Configure NRDOT Collector
Select your configuration type based on your monitoring needs:
Configuration parameters
The following table describes the key configuration parameters for the nrsqlserver receiver:
| Parameter | Description |
|---|---|
username | Enter your database username for authentication |
password | Enter your database password for authentication |
server | Enter your RDS SQL Server endpoint |
port | Enter your SQL Server port number. The default value is 1433. |
endpoint | Enter the New Relic OTLP endpoint . For more information, refer to New Relic OTLP endpoints documentation. |
licenseKey | Enter your New Relic license key. |
Sugerencia
Note: The max_concurrent_queries option controls how many metric queries the receiver executes in parallel against SQL Server during each scrape cycle.
receivers: nrsqlserver: max_concurrent_queries: 4 # default is 4 if omitted or set to 0Sugerencia
Note: If you enable all available metrics, increase the limit_mib value (e.g., 1000) to prevent the memory limiter from dropping data.
Update Windows Service Registry
Update the Windows Service Registry to use the new mssql-config.yaml file.
Method 1: PowerShell
Run the following command in PowerShell as Administrator:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\nrdot-collector" -Name "ImagePath" -Value '"C:\Program Files\nrdot-collector\nrdot-collector.exe" --config "C:\Program Files\nrdot-collector\mssql-config.yaml"'Method 2: Command Prompt (Alternative)
If PowerShell is not available, you can use Command Prompt instead:
- Open your Start Menu, type
cmd - Right-click Command Prompt and choose Run as administrator
- Copy and paste this exact command into the black CMD window and hit Enter:
sc config "nrdot-collector" binPath= "\"C:\Program Files\nrdot-collector\nrdot-collector.exe\" --config \"C:\Program Files\nrdot-collector\mssql-config.yaml\""Validate NRDOT Collector Configuration
Validate the NRDOT Collector configuration to ensure it's correctly formatted and will work properly.
& "C:\Program Files\nrdot-collector\nrdot-collector.exe" validate --config="C:\Program Files\nrdot-collector\mssql-config.yaml"Restart NRDOT collector
After updating your configuration, restart the NRDOT Collector service on your EC2 or local Windows machine:
net stop nrdot-collectornet start nrdot-collectorSugerencia
Always restart the NRDOT collector service after making configuration changes to ensure the new settings take effect.
(Optional) Set up APM-database correlation
To correlate your application performance with database operations, you can set up database service identification. This feature allows you to see exactly which applications are generating specific database workloads. For more information, refer to set up database service identification to get APM-database correlation in New Relic.
Importante
To view database performance data in APM, both entities must be in the same New Relic account. If the entities are in different New Relic accounts, you must have access to both accounts to view the data.
(Optional) Configure secret management
The secret management feature allows you to securely manage sensitive information, such as database credentials. This helps to enhance the security of your monitoring setup by avoiding hardcoding sensitive data in configuration files. For more information, refer to secret management.
Find and use your data
Once your data is being collected, you can access comprehensive SQL Server database monitoring through New Relic's UI.
To find your SQL Server database entity in New Relic:
- Go to https://one.newrelic.com > All Capabilities > Databases.
- From the Entity type dropdown, select MSSQL instance, then click Apply.
- Select your SQL Server database from the list of entities.
Prerequisites
Ensure your environment meets our compatibility and prerequisites.
Additional requirements for Windows Domain Authentication with RDS:
- Windows domain environment with Active Directory
- Domain-joined Windows EC2 instance or local machine
- RDS SQL Server configured to accept Windows Authentication
- Domain user account with appropriate SQL Server permissions
- Security group configured to allow connections on SQL Server port (default 1433)
Enable your Microsoft SQL Server
Connect to your RDS SQL Server instance using SQL Server Management Studio (SSMS) or sqlcmd with your admin credentials.
Run the following script to create a Windows domain login and grant necessary permissions:
USE master;CREATE LOGIN [DomainName\DomainUser] FROM WINDOWS;GRANT VIEW ANY DATABASE TO [DomainName\DomainUser];GRANT VIEW SERVER STATE TO [DomainName\DomainUser];GRANT VIEW ANY DEFINITION TO [DomainName\DomainUser];GOImportante
Replace DomainName\DomainUser with your actual domain and username (e.g., CORP\SQLMonitor).
Grant READ access privileges
Use the following statements to grant READ access privileges to the domain user across all databases:
-- Grant access to all databases (required for query monitoring and tempdb metrics) DECLARE @name SYSNAME; DECLARE db_cursor CURSOR READ_ONLY FORWARD_ONLY FOR SELECT [name] FROM [master].[sys].[databases] WHERE [name] NOT IN ('master','msdb','model','rdsadmin','distribution') AND [state] = 0; OPEN db_cursor; FETCH NEXT FROM db_cursor INTO @name; WHILE @@FETCH_STATUS = 0 BEGIN BEGIN TRY EXEC('USE [' + @name + ']; IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = ''DomainName\DomainUser'') BEGIN CREATE USER [DomainName\DomainUser] FOR LOGIN [DomainName\DomainUser]; END; GRANT VIEW DATABASE STATE TO [DomainName\DomainUser];'); END TRY BEGIN CATCH PRINT 'Error on ' + @name + ': ' + ERROR_MESSAGE(); END CATCH FETCH NEXT FROM db_cursor INTO @name; END CLOSE db_cursor; DEALLOCATE db_cursor; GOSugerencia
For RDS: The script automatically excludes the rdsadmin database which is reserved by AWS. Ensure you replace DomainName\DomainUser with your actual domain credentials.
Set up the NRDOT Collector
Install the NRDOT Collector on a domain-joined EC2 Windows instance or a local Windows machine that is part of the same domain and can connect to your RDS SQL Server instance.
Importante
For RDS monitoring, install the NRDOT Collector on an EC2 instance in the same VPC as your RDS instance for optimal network connectivity and lower latency.
Download and install the NRDOT Collector using PowerShell:
[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls'; $NRDOT_VERSION = (Invoke-RestMethod -Uri "https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest").tag_name; $WebClient = New-Object System.Net.WebClient; $WebClient.Headers.Add("User-Agent", "Mozilla/5.0"); $WebClient.DownloadFile("https://github.com/newrelic/nrdot-collector-releases/releases/download/$NRDOT_VERSION/nrdot-collector_${NRDOT_VERSION}_windows_x64.msi", "$env:TEMP\nrdot-collector.msi"); Start-Process msiexec.exe -ArgumentList "/i `"$env:TEMP\nrdot-collector.msi`" /qn /norestart /L*V `"$env:TEMP\nrdot_install.log`"" -Wait; Get-Service nrdot-collector -ErrorAction SilentlyContinueChange Service Logon to Domain Account (Using PowerShell):
Configure the NRDOT Collector service to run as your domain user using PowerShell:
# Configure service to use domain account# The space after obj= and password= is required syntax for sc.exesc.exe config "nrdot-collector" obj= "DomainName\DomainUser" password= "<password>"# Restart the serviceRestart-Service nrdot-collectorVerify the service identity:
Get-WmiObject Win32_Service -Filter "Name='nrdot-collector'" | Select Name, State, StartName# Expected: StartName = DomainName\DomainUserImportante
Replace
DomainName\DomainUserwith your actual domain and username (e.g.,CORP\SQLMonitor), and<password>with the domain user's password.Ensure your security group allows inbound connections from the NRDOT Collector host to your RDS instance on port 1433 (or your custom port).
Configure NRDOT Collector
Select your configuration type based on your monitoring needs:
Configuration parameters
The following table describes the key configuration parameters for the nrsqlserver receiver:
| Parameter | Description |
|---|---|
server | Enter your RDS SQL Server endpoint |
port | Enter your SQL Server port number. The default value is 1433. |
endpoint | Enter the New Relic OTLP endpoint (e.g., https://otlp.nr-data.net). For more information, refer to New Relic OTLP endpoints documentation. |
licenseKey | Enter your New Relic license key. |
collection_interval | Interval in seconds to collect database metrics. Default: 15s |
Update Windows Service Registry
Update the Windows Service Registry to use the new mssql-config.yaml file.
Method 1: PowerShell
Run the following command in PowerShell as Administrator:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\nrdot-collector" -Name "ImagePath" -Value '"C:\Program Files\nrdot-collector\nrdot-collector.exe" --config "C:\Program Files\nrdot-collector\mssql-config.yaml"'Method 2: Command Prompt (Alternative)
If PowerShell is not available, you can use Command Prompt instead:
- Open your Start Menu, type
cmd - Right-click Command Prompt and choose Run as administrator
- Copy and paste this exact command into the black CMD window and hit Enter:
sc config "nrdot-collector" binPath= "\"C:\Program Files\nrdot-collector\nrdot-collector.exe\" --config \"C:\Program Files\nrdot-collector\mssql-config.yaml\""Validate NRDOT Collector Configuration
Validate the NRDOT Collector configuration to ensure it's correctly formatted and will work properly.
& "C:\Program Files\nrdot-collector\nrdot-collector.exe" validate --config="C:\Program Files\nrdot-collector\mssql-config.yaml"Restart NRDOT collector
After updating your configuration, restart the NRDOT Collector service on your domain-joined EC2 Windows instance:
net stop nrdot-collectornet start nrdot-collectorSugerencia
Verify the service is running under the domain account by checking Windows Services (services.msc). The "Log On As" column should show your domain account (e.g., CORP\SQLMonitor).
(Optional) Set up APM-database correlation
To correlate your application performance with database operations, you can set up database service identification. This feature allows you to see exactly which applications are generating specific database workloads. For more information, refer to set up database service identification to get APM-database correlation in New Relic.
Importante
To view database performance data in APM, both entities must be in the same New Relic account. If the entities are in different New Relic accounts, you must have access to both accounts to view the data.
(Optional) Configure secret management
The secret management feature allows you to securely manage sensitive information, such as database credentials. This helps to enhance the security of your monitoring setup by avoiding hardcoding sensitive data in configuration files. For more information, refer to secret management.
Find and use your data
Once your data is being collected, you can access comprehensive SQL Server database monitoring through New Relic's UI.
To find your SQL Server database entity in New Relic:
- Go to https://one.newrelic.com > All Capabilities > Databases.
- From the Entity type dropdown, select MSSQL instance, then click Apply.
- Select your SQL Server database from the list of entities.
Prerequisites
Ensure your environment meets our compatibility and prerequisites.
Additional requirements for gMSA (Group Managed Service Account) with RDS:
- Active Directory environment with gMSA support
- gMSA account created and configured for SQL Server access
- Domain-joined Windows EC2 instance authorized to use the gMSA account
- Security group configured to allow connections on SQL Server port (default 1433)
Enable your Microsoft SQL Server
Connect to your RDS SQL Server instance and run the following SQL commands to create a login for the gMSA account and grant necessary permissions:
USE master;CREATE LOGIN [DomainName\gMSA] FROM WINDOWS;GRANT VIEW ANY DATABASE TO [DomainName\gMSA];GRANT VIEW SERVER STATE TO [DomainName\gMSA];GRANT VIEW ANY DEFINITION TO [DomainName\gMSA];Importante
Replace DomainName\gMSA with your actual domain name and gMSA account name (e.g., CORP\SQL-gMSA$). Note that gMSA accounts typically end with a $ symbol.
Grant READ access privileges
Use the following statements to grant READ access privileges to the gMSA account across all databases:
-- Grant access to all databases (required for query monitoring and tempdb metrics) DECLARE @name SYSNAME; DECLARE db_cursor CURSOR READ_ONLY FORWARD_ONLY FOR SELECT [name] FROM [master].[sys].[databases] WHERE [name] NOT IN ('master','msdb','model','rdsadmin','distribution') AND [state] = 0; OPEN db_cursor; FETCH NEXT FROM db_cursor INTO @name; WHILE @@FETCH_STATUS = 0 BEGIN BEGIN TRY EXEC('USE [' + @name + ']; IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = ''<DOMAIN>\<gMSA_NAME>$'') BEGIN CREATE USER [<DOMAIN>\<gMSA_NAME>$] FOR LOGIN [<DOMAIN>\<gMSA_NAME>$]; END; GRANT VIEW DATABASE STATE TO [<DOMAIN>\<gMSA_NAME>$];'); END TRY BEGIN CATCH PRINT 'Error on ' + @name + ': ' + ERROR_MESSAGE(); END CATCH FETCH NEXT FROM db_cursor INTO @name; END CLOSE db_cursor; DEALLOCATE db_cursor; GOImportante
Replace DomainName\gMSA with your actual domain name and gMSA account name (e.g., CORP\SQL-gMSA$). This script creates a database user for the gMSA account in all user databases, excluding system databases and RDS-specific databases.
Set up the NRDOT Collector
Install the NRDOT Collector on an EC2 Windows instance that is domain-joined and authorized to use the gMSA account.
Importante
For RDS with gMSA, the NRDOT Collector must be installed on a domain-joined Windows EC2 instance that has permissions to use the gMSA account. Ensure your security group allows connections to RDS on port 1433.
Download and install the NRDOT Collector using PowerShell:
[Net.ServicePointManager]::SecurityProtocol = 'tls12, tls'; $NRDOT_VERSION = (Invoke-RestMethod -Uri "https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest").tag_name; $WebClient = New-Object System.Net.WebClient; $WebClient.Headers.Add("User-Agent", "Mozilla/5.0"); $WebClient.DownloadFile("https://github.com/newrelic/nrdot-collector-releases/releases/download/$NRDOT_VERSION/nrdot-collector_${NRDOT_VERSION}_windows_x64.msi", "$env:TEMP\nrdot-collector.msi"); Start-Process msiexec.exe -ArgumentList "/i `"$env:TEMP\nrdot-collector.msi`" /qn /norestart /L*V `"$env:TEMP\nrdot_install.log`"" -Wait; Get-Service nrdot-collector -ErrorAction SilentlyContinue
Configure NRDOT Collector Service to Run as gMSA
After installing the NRDOT Collector, configure the service to run as your gMSA account using PowerShell:
# Stop the NRDOT Collector serviceStop-Service nrdot-collector
# Configure service to use gMSA account# Use cmd /c to avoid PowerShell treating $ as a variablecmd /c 'sc config nrdot-collector obj= "DomainName\gMSA" password= ""'
# Verify the configurationGet-WmiObject Win32_Service -Filter "Name='nrdot-collector'" | Select Name, StartName
# Start the NRDOT Collector service Start-Service nrdot-collectorImportante
Replace DomainName\gMSA with your actual domain and gMSA account name (e.g., CORP\SQL-gMSA$). Note the empty password - gMSA accounts don't require passwords.
Configure NRDOT Collector
Select your configuration type based on your monitoring needs:
Configuration parameters
The following table describes the key configuration parameters for the nrsqlserver receiver:
| Parameter | Description |
|---|---|
server | Enter your RDS SQL Server endpoint |
port | Enter your SQL Server port number. The default value is 1433. |
endpoint | Enter the New Relic OTLP endpoint. For more information, refer to New Relic OTLP endpoints documentation. |
licenseKey | Enter your New Relic license key. |
collection_interval | Interval in seconds to collect database metrics. Default: 15s |
Sugerencia
Note: The max_concurrent_queries option controls how many metric queries the receiver executes in parallel against SQL Server during each scrape cycle.
receivers: nrsqlserver: max_concurrent_queries: 4 # default is 4 if omitted or set to 0Sugerencia
Note: If you enable all available metrics, increase the limit_mib value (e.g., 1000) to prevent the memory limiter from dropping data.
Update Windows Service Registry
Update the Windows Service Registry to use the new mssql-config.yaml file.
Method 1: PowerShell
Run the following command in PowerShell as Administrator:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\nrdot-collector" -Name "ImagePath" -Value '"C:\Program Files\nrdot-collector\nrdot-collector.exe" --config "C:\Program Files\nrdot-collector\mssql-config.yaml"'Method 2: Command Prompt (Alternative)
If PowerShell is not available, you can use Command Prompt instead:
- Open your Start Menu, type
cmd - Right-click Command Prompt and choose Run as administrator
- Copy and paste this exact command into the black CMD window and hit Enter:
sc config "nrdot-collector" binPath= "\"C:\Program Files\nrdot-collector\nrdot-collector.exe\" --config \"C:\Program Files\nrdot-collector\mssql-config.yaml\""Validate NRDOT Collector Configuration
Validate the NRDOT Collector configuration to ensure it's correctly formatted and will work properly.
& "C:\Program Files\nrdot-collector\nrdot-collector.exe" validate --config="C:\Program Files\nrdot-collector\mssql-config.yaml"Restart NRDOT collector
After updating your configuration, restart the NRDOT Collector service on your domain-joined EC2 Windows instance:
net stop nrdot-collectornet start nrdot-collectorSugerencia
Verify the service is running under the gMSA account by checking Windows Services (services.msc). The "Log On As" column should show your gMSA account (e.g., CORP\SQL-gMSA$).
(Optional) Set up APM-database correlation
To correlate your application performance with database operations, you can set up database service identification. This feature allows you to see exactly which applications are generating specific database workloads. For more information, refer to set up database service identification to get APM-database correlation in New Relic.
Importante
To view database performance data in APM, both entities must be in the same New Relic account. If the entities are in different New Relic accounts, you must have access to both accounts to view the data.
(Optional) Configure secret management
The secret management feature allows you to securely manage sensitive information, such as database credentials. This helps to enhance the security of your monitoring setup by avoiding hardcoding sensitive data in configuration files. For more information, refer to secret management.
Find and use your data
Once your data is being collected, you can access comprehensive SQL Server database monitoring through New Relic's UI.
To find your SQL Server database entity in New Relic:
- Go to https://one.newrelic.com > All Capabilities > Databases.
- From the Entity type dropdown, select MSSQL instance, then click Apply.
- Select your SQL Server database from the list of entities.
Next steps
After setting up Windows RDS monitoring: