Skip to main content
APA
Sponsored by CAST AI — Kubernetes cost optimization Better Stack — Uptime monitoring and log management
⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

SQL Server Prometheus Alert Rules

2 Prometheus alerting rules for SQL Server. Exported via Ozarklake/prometheus-mssql-exporter. These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/sql-server/ozarklake-mssql-exporter.yml
critical

2.3.1. SQL Server down

SQL server instance is down

  # 1m delay allows a restart without triggering an alert.
- alert: SQLServerDown
  expr: mssql_up == 0
  for: 1m
  labels:
    severity: critical
  annotations:
    summary: SQL Server down (instance {{ $labels.instance }})
    description: "SQL server instance is down\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

2.3.2. SQL Server deadlock

SQL Server {{ $labels.instance }} is experiencing deadlocks ({{ $value }}/s)

- alert: SQLServerDeadlock
  expr: mssql_deadlocks > 5
  for: 1m
  labels:
    severity: warning
  annotations:
    summary: SQL Server deadlock (instance {{ $labels.instance }})
    description: "SQL Server {{ $labels.instance }} is experiencing deadlocks ({{ $value }}/s)\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"