Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update collector.mssql.md #1409

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions docs/collector.mssql.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,23 @@ Name | Description | Type | Labels
`windows_mssql_waitstats_transaction_ownership_waits` | Statistics relevant to processes synchronizing access to transaction | gauge | `mssql_instance`, `item`

### Example metric
_This collector does not yet have explained examples, we would appreciate your help adding them!_

Query Full table scans

```
rate(windows_mssql_accessmethods_full_scans{instance='host:9182'}[$__rate_interval])

```
## Useful queries

### Database file size
This collector retrieves the two values (data file and log file) and sums the total in PromQL to give the Database file size.

```
windows_mssql_databases_data_files_size_bytes{database='DatabaseName',instance='host:9182'} + windows_mssql_databases_log_files_size_bytes{database='DatabaseName',instance='host:9182'}

```

### Buffer Cache Hit Ratio

When you read the counter in perfmon you will get the the percentage pages found in the buffer cache. This percentage is calculated internally based on the total number of cache hits divided by the total number of cache lookups over the last few thousand page accesses.
Expand All @@ -284,4 +297,18 @@ This principal can be used for following metrics too:
- locks_count

## Alerting examples
_This collector does not yet have alerting examples, we would appreciate your help adding them!_

```
groups:
- name: database_alerts
rules:
- alert: DatabaseSizeExceeded
expr: windows_mssql_databases_data_files_size_bytes{database='DatabaseName',instance='host:9182'} + windows_mssql_databases_log_files_size_bytes{database='DatabaseName',instance='host:9182'} > 1e10 # 10 GB in bytes
for: 5m # Trigger the alert if the condition persists for 5 mins
labels:
severity: critical
annotations:
summary: "SQl EXpress Database size exceeded 10GB"
description: "The database size has grown larger than 10GB. Instance: {{ $labels.instance }}"

```
Loading