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 Linux environments to monitor AWS RDS for SQL Server instances.
Prerequisites
Ensure your environment meets our compatibility and prerequisites.
Set up the NRDOT Collector
Install the NRDOT Collector on your Linux EC2 instance or local Linux machine that can connect to your RDS SQL Server instance.
重要
Install the NRDOT Collector on an EC2 instance or local machine that has network connectivity to your RDS SQL Server instance. Ensure your security group allows inbound connections on port 1433 (or your custom port).
- Debian / Ubuntu
For AMD64 (x86_64) Architecture:
$NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_amd64.deb" --output nrdot-collector.deb && sudo dpkg -i nrdot-collector.debFor ARM64 Architecture:
$NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_arm64.deb" --output nrdot-collector.deb && sudo dpkg -i nrdot-collector.deb- RHEL / CentOS
For AMD64 (x86_64) Architecture:
$NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_x86_64.rpm" --output nrdot-collector.rpm && sudo rpm -ivh nrdot-collector.rpmFor ARM64 Architecture:
$NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_arm64.rpm" --output nrdot-collector.rpm && sudo rpm -ivh nrdot-collector.rpmConfigure database user
Connect to your RDS SQL Server instance and create the newrelic monitoring user with appropriate permissions.
Create a file named
nr-grant-permission-rds.sqlon your Linux instance with the following content:USE [master];GOCREATE LOGIN [newrelic] WITH PASSWORD = '<PASSWORD>';GO-- Instance-level permissionsGRANT VIEW SERVER STATE TO [newrelic];GRANT VIEW ANY DEFINITION TO [newrelic];GRANT VIEW ANY DATABASE TO [newrelic];GO-- Grant read access privileges to all user databasesDECLARE @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; -- Only online databasesOPEN db_cursor;FETCH NEXT FROM db_cursor INTO @name;WHILE @@FETCH_STATUS = 0BEGINBEGIN TRYEXEC('USE [' + @name + '];IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = ''newrelic'')CREATE USER [newrelic] FOR LOGIN [newrelic];');END TRYBEGIN CATCHPRINT 'Error on ' + @name + ': ' + ERROR_MESSAGE();END CATCHFETCH NEXT FROM db_cursor INTO @name;ENDCLOSE db_cursor;DEALLOCATE db_cursor;GOExecute the script using your RDS master user credentials. Replace
<YOUR-RDS-ENDPOINT>with your actual RDS endpoint and<Your_Master_Password>with your master password:bash$sqlcmd -S <YOUR-RDS-ENDPOINT> -U <YOUR_MASTER_USER> -P '<Your_Master_Password>' -C -i nr-grant-permission-rds.sql(Optional) Verify the user was created successfully:
bash$sqlcmd -S <YOUR-RDS-ENDPOINT> -U <YOUR_MASTER_USER> -P '<Your_Master_Password>' -C -Q "SELECT sp.name AS [User], p.permission_name AS [Permission_Granted] FROM sys.server_permissions p JOIN sys.server_principals sp ON p.grantee_principal_id = sp.principal_id WHERE sp.name = 'newrelic';"
ヒント
For RDS: Use your RDS master username and password 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 |
|---|---|
<YOUR_USERNAME> | Enter your database username for authentication |
<YOUR_NEWRELIC_PASSWORD> | The password you set for the newrelic user |
<YOUR-RDS-ENDPOINT> | Your RDS SQL Server endpoint (e.g., mydb-instance.xxxxxxxxxxxx.us-east-1.rds.amazonaws.com) |
port | Enter your SQL Server port number. The default value is 1433. |
<YOUR_OTLP_ENDPOINT> | Enter the New Relic OTLP endpoint. For more information, refer to New Relic OTLP endpoints documentation. |
<YOUR_LICENSE_KEY> | Enter your New Relic license key. |
ヒント
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 0ヒント
Note: If you enable all available metrics, increase the limit_mib value (e.g., 1000) to prevent the memory limiter from dropping data.
Update the collector configuration file
Run the following command to edit the service configuration:
bash$sudo nano /etc/nrdot-collector/nrdot-collector.confUpdate the config path to point to your new mssql-config.yaml file:
bash$OTELCOL_CONFIG="/etc/nrdot-collector/mssql-config.yaml"
Validate NRDOT Collector configuration
Validate the NRDOT Collector configuration to ensure it's correctly formatted and will work properly.
$sudo /usr/bin/nrdot-collector validate --config=/etc/nrdot-collector/mssql-config.yamlRestart NRDOT collector
After updating your configuration, restart the NRDOT Collector service:
$sudo systemctl restart nrdot-collectorヒント
Always restart the NRDOT collector service after making configuration changes to ensure the new settings take effect.
Next steps
After setting up Linux RDS monitoring: