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
52 changes: 47 additions & 5 deletions sqlserver/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ files:
description: |
Configure collection of AlwaysOn availability group metrics.

When the `ao_metrics.enabled` is True, use `ao_metrics.availability_group` to specify the
Set `ao_metrics.enabled` to true to enable collection of AlwaysOn metrics. Defaults to false.

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.

Set `db_backup_metrics.enabled` to true to enable collection of database backup metrics. Defaults to true.

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.

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

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

Set `db_fragmentation_metrics.enabled` to true to enable collection of
database index fragmentation statistics. Defaults to false.

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 @@ -219,7 +231,7 @@ files:
- name: enabled
type: boolean
example: false
- name: enabled_tempdb
- name: enabled_tempdb
type: boolean
example: false
- name: collection_interval
Expand All @@ -228,8 +240,11 @@ files:
display_default: 300
- name: fci_metrics
description: |
Configure collection of failover Cluster Instance metrics. Note that these metrics
Configure collection of Failover Cluster Instance metrics. Note that these metrics
requires a SQLServer set up with Failover Clustering enabled.

Set `fci_metrics.enabled` to true to enable collection of Failover Cluster Instance metrics.
Defaults to false.
value:
type: object
properties:
Expand All @@ -239,6 +254,8 @@ files:
- name: file_stats_metrics
description: |
Configure collection of file stats metrics.

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

Set `index_usage_metrics.enabled` to true to enable collection of user table index usage statistics.
Defaults to false.

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 +299,9 @@ 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.

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

Set `master_files_metrics.enabled` to true to enable collection of database file size and state metrics.
Defaults to false.
value:
type: object
properties:
Expand All @@ -299,6 +325,9 @@ 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.

Set `primary_log_shipping_metrics.enabled` to true to enable collection of primary log shipping metrics.
Defaults to false.
value:
type: object
properties:
Expand All @@ -310,6 +339,9 @@ 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.

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

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

Set `task_scheduler_metrics.enabled` to true to enable collection of additional Task and Scheduler metrics.
Defaults to false.
value:
type: object
properties:
Expand All @@ -338,23 +375,28 @@ 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.

Set `tempdb_file_space_usage_metrics.enabled` to true to enable collection of
tempdb file space usage metrics. Defaults to true.
value:
type: object
properties:
- name: enabled
type: boolean
example: false
example: true
- name: xe_metrics
description: |
Configure collection of extended events (XE) metrics.

Set `xe_metrics.enabled` to true to enable collection of extended events metrics. Defaults to false.
value:
type: object
properties:
- name: enabled
type: boolean
example: false
- name: agent_jobs
description: Configure collection of agent jobs events and metrics
description: Configure collection of SQL Server Agent jobs events and metrics
options:
- name: enabled
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class TempdbFileSpaceUsageMetrics(BaseModel):
arbitrary_types_allowed=True,
frozen=True,
)
enabled: Optional[bool] = Field(None, examples=[False])
enabled: Optional[bool] = Field(None, examples=[True])


class XeMetrics(BaseModel):
Expand Down
37 changes: 34 additions & 3 deletions sqlserver/datadog_checks/sqlserver/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ instances:
## @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
## Set `ao_metrics.enabled` to true to enable collection of AlwaysOn metrics. Defaults to false.
##
## 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,9 @@ instances:
## Note these queries can be resource intensive on large datasets. Recommend to limit these via
## autodiscovery or specific database instances.
##
## Set `db_fragmentation_metrics.enabled` to true to enable collection of
## database index fragmentation statistics. Defaults to false.
##
## 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 @@ -166,8 +171,11 @@ instances:
# db_fragmentation_metrics: {}

## @param fci_metrics - mapping - optional
## Configure collection of failover Cluster Instance metrics. Note that these metrics
## Configure collection of Failover Cluster Instance metrics. Note that these metrics
## requires a SQLServer set up with Failover Clustering enabled.
##
## Set `fci_metrics.enabled` to true to enable collection of Failover Cluster Instance metrics.
## Defaults to false.
#
# fci_metrics: {}

Expand All @@ -176,6 +184,9 @@ instances:
## Because the `sys.dm_db_index_usage_stats` view is scoped to the current database, enable
## `database_autodiscovery` or set `database`.
##
## Set `index_usage_metrics.enabled` to true to enable collection of user table index usage statistics.
## Defaults to false.
##
## 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,44 +203,64 @@ 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.
##
## Set `instance_metrics.enabled` to true to enable collection of server-level instance metrics.
## Defaults to true.
#
# instance_metrics: {}

## @param master_files_metrics - mapping - optional
## Configure collection of database file size and state from `sys.master_files`
##
## Set `master_files_metrics.enabled` to true to enable collection of database file size and state metrics.
## Defaults to false.
#
# 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.
##
## Set `primary_log_shipping_metrics.enabled` to true to enable collection of primary log shipping metrics.
## Defaults to false.
#
# 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.
##
## Set `secondary_log_shipping_metrics.enabled` to true to enable collection of secondary log shipping metrics.
## Defaults to false.
#
# secondary_log_shipping_metrics: {}

## @param task_scheduler_metrics - mapping - optional
## Configure collection of additional Task and Scheduler metrics.
##
## Set `task_scheduler_metrics.enabled` to true to enable collection of additional Task and Scheduler metrics.
## Defaults to false.
#
# 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.
##
## Set `tempdb_file_space_usage_metrics.enabled` to true to enable collection of
## tempdb file space usage metrics. Defaults to true.
#
# tempdb_file_space_usage_metrics: {}

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

## Configure collection of agent jobs events and metrics
## Configure collection of SQL Server Agent jobs events and metrics
#
# agent_jobs:

Expand Down
Loading