Skip to content
Discussion options

You must be logged in to vote

@burningalchemist

yeah, I just did a workaround instead (not to consume more of your time regarding SQL-queries itself, GPT helped out a bit too)

collector_name: mssql_availability_groups

metrics:
 - metric_name: mssql_ag_replica_health
   type: gauge
   help: 'Always On AG replica health (1 = primary, 0 = secondary). Emits 0 when no AG exists.'
   key_labels:
     - ag_name
     - replica_server_name
     - role_desc
   values:
     - is_primary_replica
   query: |
     /* All replicas from AG metadata, with role derived from runtime DMVs */
     SELECT
       ag.name                                 AS ag_name,
       ar.replica_server_name,
       COALESCE(
         rs.role_desc,
     …

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@burningalchemist
Comment options

@zofer1zohargo
Comment options

@burningalchemist
Comment options

@arindamg94
Comment options

Answer selected by burningalchemist
@burningalchemist
Comment options

Comment options

You must be logged in to vote
2 replies
@burningalchemist
Comment options

@arindamg94
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants