You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switch replica_sync_state to use per-replica DMV (DataDog#23310)
* Switch replica_sync_state to use per-replica DMV
The previous query used sys.dm_hadr_database_replica_states which returns
one row per database per replica, but lacked a database_name tag. This
caused metric collisions for AGs with multiple databases. Switch to
sys.dm_hadr_availability_replica_states which returns one row per replica,
matching the metric's intent.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Apply ruff formatting changes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* changelog update
* changelog update
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Keep synchronization_state_desc and synchronization_state tags for backward compatibility
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove synchronization_health_desc tag, keep original tag names
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update changelog to reflect preserved tag names
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Alias synchronization_health columns in SQL query for clarity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Alias synchronization_health columns in SQL query for clarity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix changelog wording
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Drop synchronization_state tag (was not present before)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Switch `sqlserver.ao.replica_sync_state` from `sys.dm_hadr_database_replica_states` to `sys.dm_hadr_availability_replica_states` to report per-replica synchronization health instead of per-database synchronization state. The `synchronization_state_desc` tag name is preserved for backward compatibility, but its values now reflect the replica-level health rollup (e.g. `HEALTHY`, `PARTIALLY_HEALTHY`, `NOT_HEALTHY`). The previous implementation was broken for availability groups containing multiple databases, as rows would collide on the same tag set and only the last value was reported. To get per-database synchronization state, use `sqlserver.ao.replica_status` which includes a `synchronization_state` tag with full database-level granularity.
sqlserver.ao.secondary_lag_seconds,gauge,,second,,"The number of seconds that the secondary replica is behind the primary replica during synchronization. Tags: `availability_group`, `availability_group_name`, `replica_server_name`, `failover_mode`, `availability_mode`, `db`, `replica_id`, `database_id`, `database_state`, `synchronization_state`, `failover_cluster`, `replica_role`",0,sql_server,secondary lag seconds,,
30
30
sqlserver.ao.secondary_replica_health,gauge,,,,"Recovery health of secondary replica: 0 = In progress, 1 = Online. The metric is not emitted if on a primary replica. Tags: `availability_group`, `availability_group_name`, `synchronization_health_desc`",0,sql_server,secondary replica health,,
31
31
sqlserver.buffer.cache_hit_ratio,gauge,,fraction,,The ratio of data pages found and read from the buffer cache over all data page requests. (Perf. Counter: `Buffer Manager - Buffer cache hit ratio`),1,sql_server,buff hit ratio,,
0 commit comments