Regenerate integrations docs (#21933)
Co-authored-by: ilyam8 <22274335+ilyam8@users.noreply.github.com>
Netdata bot committed
Mar 10, 2026 at 19:13 UTC
9e44fb7b9b33acb1bf6efe81c66281005edd0d59
1 file changed
+129
src/go/plugin/go.d/collector/mssql/integrations/microsoft_sql_server.md
+129
@@ -28,6 +28,7 @@ It collects metrics from:
28
- Dynamic management views (DMVs) for wait statistics, locks, and sessions
29
- Per-database transaction and lock statistics
30
- SQL Server Agent job status
31
+- Always On Availability Group health, replica states, and per-database synchronization metrics
32
33
34
It connects to the SQL Server instance via TCP using the go-mssqldb driver and executes queries against:
@@ -41,6 +42,13 @@ It connects to the SQL Server instance via TCP using the go-mssqldb driver and e
42
- `sys.dm_os_sys_memory` - OS physical memory and page file
43
- `sys.master_files` - Database file sizes
44
- `msdb.dbo.sysjobs` - SQL Agent job status
45
+- `sys.dm_hadr_availability_group_states` - AG health rollup
46
+- `sys.dm_hadr_availability_replica_states` - Replica operational state
47
+- `sys.dm_hadr_database_replica_states` - Database sync queues and rates
48
+- `sys.dm_hadr_cluster` / `sys.dm_hadr_cluster_members` - WSFC cluster health
49
+- `sys.dm_hadr_database_replica_cluster_states` - Failover readiness
50
+- `sys.dm_hadr_auto_page_repair` - Automatic page repair events
51
+- `sys.dm_hadr_ag_threads` - AG thread usage (SQL Server 2019+)
52
53
54
This collector is supported on all platforms.
@@ -50,6 +58,8 @@ This collector supports collecting metrics from multiple instances of this integ
58
The monitoring user requires the VIEW SERVER STATE permission to access DMVs.
59
SQL Agent job monitoring is part of collector startup, so access to
60
`msdb.dbo.sysjobs` is required.
61
+Always On AG monitoring requires VIEW ANY DEFINITION for access to availability group catalog views.
62
+On SQL Server 2022+, HADR DMVs may additionally require VIEW SERVER PERFORMANCE STATE.
63
64
65
Microsoft SQL Server can be monitored further using the following other integrations:
@@ -237,6 +247,117 @@ Metrics:
247
| mssql.replication_latency | average, best, worst | seconds | • | • |
248
| mssql.replication_subscriptions | total, agents_running | subscriptions | • | • |
249
250
+### Per availability group
251
+
252
+These metrics refer to Always On Availability Groups. Auto-detected when HADR is enabled.
253
+
254
+Labels:
255
+
256
+| Label | Description |
257
+|:-----------|:----------------|
258
+| ag_name | Availability group name |
259
+
260
+Metrics:
261
+
262
+| Metric | Dimensions | Unit | SQL Server 2016+ | Azure SQL Database |
263
+|:------|:----------|:----|:---:|:---:|
264
+| mssql.ag_sync_health | not_healthy, partially_healthy, healthy | state | • | • |
265
+| mssql.ag_recovery_health | primary_online, primary_in_progress, secondary_online, secondary_in_progress | state | • | • |
266
+| mssql.ag_threads | capture, redo, parallel_redo | threads | • | • |
267
+
268
+### Per availability group replica
269
+
270
+These metrics refer to per-replica state within an Availability Group. Note: on secondary replicas, the replica states DMV returns only local information.
271
+
272
+Labels:
273
+
274
+| Label | Description |
275
+|:-----------|:----------------|
276
+| ag_name | Availability group name |
277
+| replica_server | Replica server name |
278
+| availability_mode | Availability mode (synchronous_commit or asynchronous_commit) |
279
+| failover_mode | Failover mode (automatic or manual) |
280
+
281
+Metrics:
282
+
283
+| Metric | Dimensions | Unit | SQL Server 2016+ | Azure SQL Database |
284
+|:------|:----------|:----|:---:|:---:|
285
+| mssql.ag_replica_role | primary, secondary, resolving, unknown | state | • | • |
286
+| mssql.ag_replica_connected_state | connected, disconnected, unknown | state | • | • |
287
+| mssql.ag_replica_sync_health | not_healthy, partially_healthy, healthy | state | • | • |
288
+
289
+### Per availability group database replica
290
+
291
+These metrics refer to per-database synchronization within an Availability Group.
292
+
293
+Labels:
294
+
295
+| Label | Description |
296
+|:-----------|:----------------|
297
+| ag_name | Availability group name |
298
+| replica_server | Replica server name |
299
+| database | Database name |
300
+
301
+Metrics:
302
+
303
+| Metric | Dimensions | Unit | SQL Server 2016+ | Azure SQL Database |
304
+|:------|:----------|:----|:---:|:---:|
305
+| mssql.ag_db_sync_state | not_synchronizing, synchronizing, synchronized, reverting, initializing | state | • | • |
306
+| mssql.ag_db_log_send_queue | queue_size | bytes | • | • |
307
+| mssql.ag_db_log_send_rate | send_rate | bytes/s | • | • |
308
+| mssql.ag_db_redo_queue | queue_size | bytes | • | • |
309
+| mssql.ag_db_redo_rate | redo_rate | bytes/s | • | • |
310
+| mssql.ag_db_filestream_send_rate | send_rate | bytes/s | • | • |
311
+| mssql.ag_db_secondary_lag | lag | seconds | • | • |
312
+| mssql.ag_db_suspended | active, suspended | state | • | • |
313
+| mssql.ag_db_failover_readiness | ready, not_ready | state | • | • |
314
+| mssql.ag_db_joined_state | joined, not_joined | state | • | • |
315
+
316
+### Per WSFC cluster
317
+
318
+These metrics refer to the Windows Server Failover Clustering quorum state.
319
+
320
+This scope has no labels.
321
+
322
+Metrics:
323
+
324
+| Metric | Dimensions | Unit | SQL Server 2016+ | Azure SQL Database |
325
+|:------|:----------|:----|:---:|:---:|
326
+| mssql.ag_cluster_quorum_state | normal, forced, unknown | state | • | • |
327
+
328
+### Per WSFC cluster member
329
+
330
+These metrics refer to individual WSFC cluster members.
331
+
332
+Labels:
333
+
334
+| Label | Description |
335
+|:-----------|:----------------|
336
+| cluster_member | Cluster member name |
337
+
338
+Metrics:
339
+
340
+| Metric | Dimensions | Unit | SQL Server 2016+ | Azure SQL Database |
341
+|:------|:----------|:----|:---:|:---:|
342
+| mssql.ag_cluster_member_state | up, down | state | • | • |
343
+| mssql.ag_cluster_member_quorum_votes | votes | votes | • | • |
344
+
345
+### Per AG page repair
346
+
347
+These metrics refer to automatic page repair events per database in an Availability Group.
348
+
349
+Labels:
350
+
351
+| Label | Description |
352
+|:-----------|:----------------|
353
+| database | Database name |
354
+
355
+Metrics:
356
+
357
+| Metric | Dimensions | Unit | SQL Server 2016+ | Azure SQL Database |
358
+|:------|:----------|:----|:---:|:---:|
359
+| mssql.ag_page_repair | successful, failed | repairs | • | • |
360
+
361
362
363
## Functions
@@ -546,6 +667,12 @@ CREATE LOGIN netdata_user WITH PASSWORD = 'YourStrongPassword!';
667
-- Grant VIEW SERVER STATE (required for DMVs)
668
GRANT VIEW SERVER STATE TO netdata_user;
669
670
+-- Grant VIEW ANY DEFINITION (required for Always On AG monitoring)
671
+GRANT VIEW ANY DEFINITION TO netdata_user;
672
+
673
+-- Grant VIEW SERVER PERFORMANCE STATE (required for HADR DMVs on SQL Server 2022+)
674
+-- GRANT VIEW SERVER PERFORMANCE STATE TO netdata_user;
675
+
676
-- Grant access to msdb for SQL Agent job monitoring (required)
677
USE msdb;
678
CREATE USER netdata_user FOR LOGIN netdata_user;
@@ -565,6 +692,8 @@ GRANT SELECT ON dbo.MSsubscriptions TO netdata_user;
692
- `SELECT on msdb.dbo.sysjobs` - SQL Agent job status monitoring
693
694
**Optional permissions:**
695
+- `VIEW ANY DEFINITION` - Always On Availability Group monitoring
696
+- `VIEW SERVER PERFORMANCE STATE` - HADR DMVs on SQL Server 2022+
697
- `SELECT on distribution.dbo.MSreplication_monitordata` - Replication monitoring
698
- `SELECT on distribution.dbo.MSpublications` - Publication information
699
- `SELECT on distribution.dbo.MSsubscriptions` - Subscription counts