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

Clarify the enabled property in database_metrics configuration descriptions for sqlserver #19288

Merged
merged 11 commits into from
Dec 21, 2024
37 changes: 35 additions & 2 deletions sqlserver/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ files:
display_default: true
- name: database_metrics
description: |
Configure the collection of database metrics
Configure the collection of database metrics. Requires `dbm: true`.
azhou-datadog marked this conversation as resolved.
Show resolved Hide resolved
options:
- name: ao_metrics
description: |
Configure collection of AlwaysOn availability group metrics.

When the `ao_metrics.enabled` is True, use `ao_metrics.availability_group` to specify the
Use `ao_metrics.enabled: true` to enable collection of AlwaysOn metrics.

When `ao_metrics.enabled` is True, use `ao_metrics.availability_group` to specify the
resource group id of a specific availability group that you would like to monitor.
If no availability group is specified, then we will collect AlwaysOn metrics for all
availability groups on the current replica.
Expand All @@ -163,6 +165,9 @@ files:
- name: db_backup_metrics
description: |
Configure collection of database backup metrics.

Use `db_backup_metrics.enabled` to enable collection of database backup metrics.

Use `db_backup_metrics.collection_interval` to set the interval (in seconds) for the collection of
database backup metrics. Defaults to 300 seconds (5 minutes). If you intend on updating this value,
it is strongly recommended to use a consistent value throughout all SQL Server agent deployments.
Expand All @@ -180,6 +185,8 @@ files:
- name: db_files_metrics
description: |
Configure collection of database files metrics.

Use `db_files_metrics.enabled` to enable collection of database files metrics.
hidden: true
value:
type: object
Expand All @@ -190,6 +197,8 @@ files:
- name: db_stats_metrics
description: |
Configure collection of database stats metrics

Use `db_stats_metrics.enabled` to enable collection of database stats metrics.
hidden: true
value:
type: object
Expand All @@ -203,6 +212,8 @@ files:
Note these queries can be resource intensive on large datasets. Recommend to limit these via
autodiscovery or specific database instances.

Use `db_fragmentation_metrics.enabled` to enable collection of database index fragmentation statistics

Use `db_fragmentation_metrics.enabled_tempdb` to enable collection of database index fragmentation statistics
in tempdb database from the `sys.dm_db_index_physical_stats` DMF.
By default, we do not collect index fragmentation statistics in the tempdb database, as those queries
Expand Down Expand Up @@ -230,6 +241,8 @@ files:
description: |
Configure collection of failover Cluster Instance metrics. Note that these metrics
requires a SQLServer set up with Failover Clustering enabled.

Use `fci_metrics.enabled` to enable collection of failover Cluster Instance metrics.
value:
type: object
properties:
Expand All @@ -239,6 +252,8 @@ files:
- name: file_stats_metrics
description: |
Configure collection of file stats metrics.

Use `file_stats_metrics.enabled` to enable collection of file stats metrics.
hidden: true
value:
type: object
Expand All @@ -252,6 +267,8 @@ files:
Because the `sys.dm_db_index_usage_stats` view is scoped to the current database, enable
`database_autodiscovery` or set `database`.

Use `index_usage_metrics.enabled` to enable collection of user table index usage statistics

Use `index_usage_metrics.enabled_tempdb` to enable collection of user table index usage statistics in tempdb
database from the `sys.dm_db_index_usage_stats` DMV.
By default, we do not collect index usage statistics in the tempdb database, as those queries
Expand Down Expand Up @@ -279,6 +296,8 @@ files:
description: |
Configure collection of server-level instance metrics. When setting up multiple instances for
different databases on the same host these metrics will be duplicated unless this option is turned off.

Use `instance_metrics.enabled` to enable collection of server-level instance metrics.
value:
type: object
properties:
Expand All @@ -288,6 +307,8 @@ files:
- name: master_files_metrics
description: |
Configure collection of database file size and state from `sys.master_files`

Use `master_files_metrics.enabled` to enable collection of database file size and state metrics.
value:
type: object
properties:
Expand All @@ -299,6 +320,8 @@ files:
Configure collection of metrics for a log shipping setup. Required to run against the
primary instance in a transaction log shipping configuration. Note that
the Datadog user needs to be present in msdb and must be added to the db_datareader role.

Use `primary_log_shipping_metrics.enabled` to enable collection of primary log shipping metrics.
value:
type: object
properties:
Expand All @@ -310,6 +333,8 @@ files:
Configure collection of metrics for a log shipping setup. Required to run against the
secondary instance in a transaction log shipping configuration. Note that
the Datadog user needs to be present in msdb and must be added to the db_datareader role.

Use `secondary_log_shipping_metrics.enabled` to enable collection of secondary log shipping metrics.
value:
type: object
properties:
Expand All @@ -319,6 +344,8 @@ files:
- name: server_state_metrics
description: |
Configure collection of server state metrics

Use `server_state_metrics.enabled` to enable collection of server state metrics.
hidden: true
value:
type: object
Expand All @@ -329,6 +356,8 @@ files:
- name: task_scheduler_metrics
description: |
Configure collection of additional Task and Scheduler metrics.

Use `task_scheduler_metrics.enabled` to enable collection of additional Task and Scheduler metrics.
value:
type: object
properties:
Expand All @@ -338,6 +367,8 @@ files:
- name: tempdb_file_space_usage_metrics
description: |
Configure collection of tempdb file space usage metrics for how space is used in tempdb data files.

Use `tempdb_file_space_usage_metrics.enabled` to enable collection of tempdb file space usage metrics.
value:
type: object
properties:
Expand All @@ -347,6 +378,8 @@ files:
- name: xe_metrics
description: |
Configure collection of extended events (XE) metrics.

Use `xe_metrics.enabled` to enable collection of extended events metrics.
value:
type: object
properties:
Expand Down
26 changes: 24 additions & 2 deletions sqlserver/datadog_checks/sqlserver/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,16 @@ instances:
#
autodiscovery_db_service_check: false

## Configure the collection of database metrics
## Configure the collection of database metrics. Requires `dbm: true`.
#
# database_metrics:

## @param ao_metrics - mapping - optional
## Configure collection of AlwaysOn availability group metrics.
##
## When the `ao_metrics.enabled` is True, use `ao_metrics.availability_group` to specify the
## Use `ao_metrics.enabled: true` to enable collection of AlwaysOn metrics.
##
## When `ao_metrics.enabled` is True, use `ao_metrics.availability_group` to specify the
## resource group id of a specific availability group that you would like to monitor.
## If no availability group is specified, then we will collect AlwaysOn metrics for all
## availability groups on the current replica.
Expand All @@ -152,6 +154,8 @@ instances:
## Note these queries can be resource intensive on large datasets. Recommend to limit these via
## autodiscovery or specific database instances.
##
## Use `db_fragmentation_metrics.enabled` to enable collection of database index fragmentation statistics
##
## Use `db_fragmentation_metrics.enabled_tempdb` to enable collection of database index fragmentation statistics
## in tempdb database from the `sys.dm_db_index_physical_stats` DMF.
## By default, we do not collect index fragmentation statistics in the tempdb database, as those queries
Expand All @@ -168,6 +172,8 @@ instances:
## @param fci_metrics - mapping - optional
## Configure collection of failover Cluster Instance metrics. Note that these metrics
azhou-datadog marked this conversation as resolved.
Show resolved Hide resolved
## requires a SQLServer set up with Failover Clustering enabled.
##
## Use `fci_metrics.enabled` to enable collection of failover Cluster Instance metrics.
#
# fci_metrics: {}

Expand All @@ -176,6 +182,8 @@ instances:
## Because the `sys.dm_db_index_usage_stats` view is scoped to the current database, enable
## `database_autodiscovery` or set `database`.
##
## Use `index_usage_metrics.enabled` to enable collection of user table index usage statistics
azhou-datadog marked this conversation as resolved.
Show resolved Hide resolved
##
## Use `index_usage_metrics.enabled_tempdb` to enable collection of user table index usage statistics in tempdb
## database from the `sys.dm_db_index_usage_stats` DMV.
## By default, we do not collect index usage statistics in the tempdb database, as those queries
Expand All @@ -192,40 +200,54 @@ instances:
## @param instance_metrics - mapping - optional
## Configure collection of server-level instance metrics. When setting up multiple instances for
## different databases on the same host these metrics will be duplicated unless this option is turned off.
##
## Use `instance_metrics.enabled` to enable collection of server-level instance metrics.
#
# instance_metrics: {}

## @param master_files_metrics - mapping - optional
## Configure collection of database file size and state from `sys.master_files`
##
## Use `master_files_metrics.enabled` to enable collection of database file size and state metrics.
#
# master_files_metrics: {}

## @param primary_log_shipping_metrics - mapping - optional
## Configure collection of metrics for a log shipping setup. Required to run against the
## primary instance in a transaction log shipping configuration. Note that
## the Datadog user needs to be present in msdb and must be added to the db_datareader role.
##
## Use `primary_log_shipping_metrics.enabled` to enable collection of primary log shipping metrics.
#
# primary_log_shipping_metrics: {}

## @param secondary_log_shipping_metrics - mapping - optional
## Configure collection of metrics for a log shipping setup. Required to run against the
## secondary instance in a transaction log shipping configuration. Note that
## the Datadog user needs to be present in msdb and must be added to the db_datareader role.
##
## Use `secondary_log_shipping_metrics.enabled` to enable collection of secondary log shipping metrics.
#
# secondary_log_shipping_metrics: {}

## @param task_scheduler_metrics - mapping - optional
## Configure collection of additional Task and Scheduler metrics.
##
## Use `task_scheduler_metrics.enabled` to enable collection of additional Task and Scheduler metrics.
#
# task_scheduler_metrics: {}

## @param tempdb_file_space_usage_metrics - mapping - optional
## Configure collection of tempdb file space usage metrics for how space is used in tempdb data files.
##
## Use `tempdb_file_space_usage_metrics.enabled` to enable collection of tempdb file space usage metrics.
#
# tempdb_file_space_usage_metrics: {}

## @param xe_metrics - mapping - optional
## Configure collection of extended events (XE) metrics.
##
## Use `xe_metrics.enabled` to enable collection of extended events metrics.
#
# xe_metrics: {}

Expand Down
Loading