Monitor your SQL Server database performance with comprehensive metrics collected by the NRDOT Collector. By default, New Relic collects the metrics referenced in the Available metrics section. You can enhance your monitoring by enabling your desired metrics listed in the Additional metrics section.
Available metrics
The following metrics are collected automatically for New Relic UI functionality. These are enabled by default and work on any platform via a direct SQL Server connection.
Metric | Description | Unit | Type |
|---|---|---|---|
| Number of batch requests received by SQL Server |
| Gauge (double) |
| Number of SQL compilations needed |
| Gauge (double) |
| Number of SQL recompilations needed |
| Gauge (double) |
| Number of lock requests resulting in a wait |
| Gauge (double) |
| Pages found in the buffer pool without having to read from disk |
| Gauge (double) |
| Time a page will stay in the buffer pool. Available attributes: |
| Gauge (int) |
| Number of users connected to the SQL Server |
| Gauge (int) |
Additional metrics
The following metrics are disabled by default but can be enabled for deeper insights into SQL Server performance and health. These metrics are organized by functionality and most require a direct SQL Server connection.
Metric | Description | Unit | Type |
|---|---|---|---|
| Number of SQL attentions (client cancellation interrupts) received per second |
| Gauge (double) |
| Number of SQL compilations per batch request |
| Gauge (double) |
| Number of page splits per batch request |
| Gauge (double) |
| Ratio of SQL recompilations to compilations, expressed as a percentage |
| Gauge (double) |
| Rate of auto-parameterization activity, broken down by result. Available attributes: |
| Gauge (double) |
| Rate of plan executions, classified by plan guide result. Available attributes: |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Total number of backups/restores |
| Gauge (double) |
| The number of databases. Available attributes: |
| Gauge (int) |
| Number of execution errors |
| Gauge (int) |
| Size of database files. Available attributes: |
| Gauge (int) |
| The number of unrestricted full table or index scans |
| Gauge (double) |
| Number of active transactions in the database. Available attributes: |
| Gauge (int) |
| Total number of deadlocks |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| The number of bytes of I/O on this file. Available attributes: |
| Sum (cumulative, int) |
| Total time that the users waited for I/O issued on this file. Available attributes: |
| Sum (cumulative, double) |
| The number of operations issued on the file. Available attributes: |
| Sum (cumulative, int) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Cluster type of the Always-On Availability Group. Available attributes: |
| Gauge (int) |
| Failure condition level configured for the Availability Group (1-5). Available attributes: |
| Gauge (int) |
| Health-check timeout configured for the Availability Group. Available attributes: |
| Gauge (int) |
| Number of synchronized secondary replicas required to commit on the Availability Group. Available attributes: |
| Gauge (int) |
| Size of the log-send or redo queue for an AG database replica. Available attributes: |
| Gauge (int) |
| Redo rate for an AG database replica. Available attributes: |
| Gauge (double) |
| Cumulative time spent in AG flow control, in milliseconds per second observed |
| Gauge (double) |
| Role of the availability replica. Available attributes: |
| Gauge (int) |
| Synchronization health of the availability replica. Available attributes: |
| Gauge (int) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Total number of index searches |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Number of superlatches currently active |
| Gauge (int) |
| Rate of superlatch promotions or demotions. Available attributes: |
| Gauge (double) |
| Number of latch waits per second |
| Gauge (double) |
| Average time spent waiting for latches (lighter-weight synchronization) |
| Gauge (double) |
| Total latch wait time |
| Sum (cumulative, double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Total number of lock timeouts |
| Gauge (double) |
| Cumulative count of lock waits that occurred. Available attributes: |
| Sum (cumulative, int) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Total number of logins |
| Gauge (double) |
| Total number of logouts |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Amount of memory used by the SQL Server memory pool. Available attributes: |
| Gauge (int) |
| Number of cache objects in the SQL Server cache. Available attributes: |
| Gauge (int) |
| Total number of memory grants pending |
| Sum (cumulative, int) |
| Number of pages in the SQL Server buffer pool. Available attributes: |
| Gauge (int) |
| Total memory in use. Available attributes: |
| Sum (cumulative, double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Computer uptime |
| Gauge (int) |
| Number of CPUs |
| Gauge (int) |
| Total disk space across volumes hosting SQL Server database files |
| Gauge (int) |
| Amount of system physical memory observed by SQL Server. Available attributes: |
| Gauge (int) |
| Fraction of system physical memory in use by the SQL Server process |
| Gauge (double) |
| Total number of runnable tasks across online schedulers |
| Gauge (int) |
| Total wait time for this wait type. Available attributes: |
| Sum (cumulative, double) |
| Cumulative number of tasks that have waited on this wait type since SQL Server startup. Available attributes: |
| Sum (cumulative, int) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Number of free list stalls |
| Gauge (int) |
| Total number of page lookups |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Number of SQL Server processes (user sessions), broken down by status. Available attributes: |
| Gauge (int) |
| The number of processes that are currently blocked |
| Gauge (int) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Throughput rate of replica data. Available attributes: |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| The rate of operations issued. Available attributes: |
| Gauge (double) |
| The number of read operations that were throttled in the last second |
| Gauge (int) |
| The number of write operations that were throttled in the last second |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| The number of tables. Available attributes: |
| Sum (cumulative, int) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Total free space in temporary DB. Available attributes: |
| Sum (cumulative, int) |
| TempDB version store size |
| Gauge (double) |
| Cumulative wait time on tempdb allocation pages, broken down by page type. Available attributes: |
| Sum (cumulative, double) |
| Number of tempdb pagelatch wait types with at least one active waiter |
| Gauge (int) |
| Number of tempdb data files configured on the instance |
| Gauge (int) |
| Size of each tempdb data or log file. Available attributes: |
| Gauge (int) |
| Space used by tempdb, broken down by allocation category. Available attributes: |
| Gauge (int) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Number of SQL Server tasks broken down by state. Available attributes: |
| Gauge (int) |
| Number of SQL Server worker threads broken down by state. Available attributes: |
| Gauge (int) |
| Maximum number of SQL Server worker threads configured on the instance |
| Gauge (int) |
| Fraction of configured SQL Server worker threads currently running |
| Gauge (double) |
Metric | Description | Unit | Type |
|---|---|---|---|
| Time consumed in transaction delays |
| Sum (cumulative, double) |
| Age in seconds of the longest currently-open transaction on the server |
| Gauge (double) |
| Total number of mirror write transactions |
| Gauge (double) |
| Cumulative bytes cleaned from the tempdb version store |
| Sum (cumulative, double) |
| Cumulative bytes of row versions written to the tempdb version store |
| Sum (cumulative, double) |
Additional Windows metrics
The following metrics are available on Windows platforms when using the NRDOT Collector with SQL Server. These metrics provide Windows-specific performance insights for SQL Server monitoring.
Metric | Description | Unit | Type |
|---|---|---|---|
| System uptime counter |
| Gauge (double) |
| Number of CPU cores available |
| Gauge (double) |
| Memory usage by SQL Server process. Available attributes: |
| Gauge (double) |
| Percentage of pages found in the buffer cache |
| Gauge (double) |
| Ratio of cache hits to cache lookups. Available attributes: |
| Gauge (double) |
| Number of SQL compilations per second |
| Gauge (double) |
| Number of user connections to SQL Server |
| Gauge (double) |
| Number of current locks. Available attributes: |
| Gauge (double) |
| Number of lock timeouts per second |
| Gauge (double) |
| Total number of processes waiting for memory grants |
| Gauge (double) |
| Number of physical database page operations per second. Available attributes: |
| Gauge (double) |
| Number of SQL recompilations per second |
| Gauge (double) |
| Number of transactions per second. Available attributes: |
| Gauge (double) |
Log events
The following events are collected as OpenTelemetry log records when enabled under the events section of your configuration. They provide query-level visibility: active query samples, top queries, execution plans, and top stored procedures.
Per-session active query samples. Captures the current execution state of active SQL Server sessions at collection time.
Attribute name | Description |
|---|---|
| The text of the database query being executed |
| The database management system (DBMS) product as identified by the client instrumentation |
| The database name |
| Login name associated with the SQL Server session |
| Hostname or address of the client |
| TCP port used by the client |
| IP address of the peer client |
| TCP port used by the peer client |
| ID of the SQL Server session |
| Status of the session (for example, running, sleeping) |
| Timestamp when the session was established (login time), in ISO 8601 format |
| Total elapsed time in seconds since the session was established |
| Name of the client application that initiated the session |
| SQL command type being executed |
| Status of the request (for example, running, suspended) |
| CPU time consumed by the query, in seconds |
| Number of logical reads (data read from cache/memory) |
| Number of physical reads performed by the query |
| Number of writes performed by the query |
| Number of rows affected or returned by the query |
| Total elapsed time for completed executions of this plan, reported in delta seconds |
| Percentage of work completed |
| Estimated time remaining for the request to complete, in seconds |
| Type of wait encountered by the request. Empty if none |
| Duration in seconds the request has been waiting |
| The resource for which the session is waiting |
| SQL Server identifier for the locked or waited-on resource, if available |
| SQL Server type of the locked or waited-on resource, if available |
| Session ID that is blocking the current session. 0 if none |
| Timestamp of when the current blocking wait began, in ISO 8601 format |
| Deadlock priority value for the session |
| Lock timeout value in seconds |
| Number of transactions currently open in the session |
| Unique ID of the active transaction |
| Transaction isolation level used in the session, represented as a numeric constant |
| Binary hash value calculated on the query and used to identify queries with similar logic, reported in HEX format |
| Binary hash value calculated on the query execution plan and used to identify similar query execution plans, reported in HEX format |
| Timestamp of when the SQL query started, in ISO 8601 format |
| Context information for the session, represented as a hexadecimal string |
| The SQL Server ID of the stored procedure, if any |
| The name of the stored procedure, if any |
| The full text of the SQL batch or stored procedure the statement was extracted from. Only populated when |
| New Relic service GUID extracted from the filtered query comments. Empty unless |
| MD5 hash of the normalized full SQL query text. Used for correlation with APM slow query traces. Only populated when |
Collection of event metrics for top N queries, filtered based on the highest elapsed time consumed in the collection interval.
Attribute name | Description |
|---|---|
| The text of the database query being executed |
| The database management system (DBMS) product as identified by the client instrumentation |
| The database name |
| Number of times that the plan has been executed since it was last compiled, reported in delta value |
| Total amount of CPU time that was consumed by executions of this plan since it was compiled, reported in delta seconds |
| Total elapsed time for completed executions of this plan, reported in delta seconds |
| Total number of logical reads performed by executions of this plan since it was compiled, reported in delta value |
| Total number of logical writes performed by executions of this plan since it was compiled, reported in delta value |
| Total number of physical reads performed by executions of this plan since it was compiled, reported in delta value |
| Total number of rows returned by the query, reported in delta value |
| The total amount of reserved memory grant in KB this plan received since it was compiled, reported in delta value |
| Binary hash value calculated on the query and used to identify queries with similar logic, reported in HEX format |
| The query execution plan used by SQL Server |
| Binary hash value calculated on the query execution plan and used to identify similar query execution plans, reported in HEX format |
| Timestamp of when the SQL query last started executing, in ISO 8601 format |
| Timestamp of when the SQL query execution plan was compiled, in ISO 8601 format |
| The SQL Server ID of the stored procedure, if any |
| The name of the stored procedure, if any |
| Number of times that the procedure has been executed since it was last compiled, reported in delta value |
| The full text of the SQL batch or stored procedure the statement was extracted from. Only populated when |
| New Relic service GUID extracted from the filtered query comments. Empty unless |
| MD5 hash of the normalized full SQL query text. Used for correlation with APM slow query traces. Only populated when |
The query execution plan. When enabled, the plan is reported here instead of on db.server.top_query, so an oversized plan payload can't drop the lightweight query statistics alongside it.
Attribute name | Description |
|---|---|
| The database management system (DBMS) product as identified by the client instrumentation |
| The database name |
| Binary hash value calculated on the query and used to identify queries with similar logic, reported in HEX format |
| The query execution plan used by SQL Server |
| Binary hash value calculated on the query execution plan and used to identify similar query execution plans, reported in HEX format |
Aggregated performance metrics for the top stored procedures by elapsed time, computed as deltas over the collection interval. Correlates with db.server.top_query and db.server.query_sample via sqlserver.procedure_id.
Tip
Requires SQL Server 2017 CU3 or later, which introduced support for sys.dm_exec_procedure_stats.total_spills. On earlier versions, this event doesn't emit data and logs an error. Other events remain unaffected.
Attribute name | Description |
|---|---|
| The database management system (DBMS) product as identified by the client instrumentation |
| The database name |
| The SQL Server ID of the stored procedure, if any |
| The name of the stored procedure, if any |
| The name of the database schema |
| Number of times that the procedure has been executed since it was last compiled, reported in delta value |
| Total amount of CPU time that was consumed by executions of this plan since it was compiled, reported in delta seconds |
| Total elapsed time for completed executions of this plan, reported in delta seconds |
| Total number of logical reads performed by executions of this plan since it was compiled, reported in delta value |
| Total number of logical writes performed by executions of this plan since it was compiled, reported in delta value |
| Total number of physical reads performed by executions of this plan since it was compiled, reported in delta value |
| Pages spilled to tempdb by the procedure over the collection interval, reported as a delta |
| Longest elapsed time for a single execution of the procedure, in seconds. Covers the whole period the plan has been cached, so unlike the other durations it isn't a delta |
| Shortest elapsed time for a single execution of the procedure, in seconds. Covers the whole period the plan has been cached, so unlike the other durations it isn't a delta |
| ISO 8601 timestamp of the last execution of the procedure |
Amazon RDS limitations
When monitoring an Amazon RDS for SQL Server instance, certain metrics may report 0 or not be collected due to RDS service restrictions and SQL Server edition limitations.
Important
The following limitations apply specifically to SQL Server instances running on Amazon RDS. Self-hosted SQL Server deployments are not affected by these restrictions.
Metric | Limitation | Affected editions |
|---|---|---|
| Always reports | All editions |
| Not collected. Always On Availability Groups require Multi-AZ deployment, unavailable on Web and Express editions. | Web, Express |
| Emitted but always reports | Web, Express |
For more information, refer to Amazon RDS for SQL Server: Unsupported features and Multi-AZ for Amazon RDS for SQL Server.
Related documentation
Linux instrumentation for self-hosted environments
Learn how to set up MSSQL monitoring in self-hosted Linux environments with New Relic.
Windows instrumentation for self-hosted environments
Learn how to set up MSSQL monitoring in self-hosted Windows environments with New Relic.
Set up APM-database correlation
Learn how to correlate your application performance with database operations in New Relic.